In the UBW final battle, how come Shirou could use Rho Aias? Archer mentioned it was from the Trojan War (probably learned it while working as a counter force), but Shirou hadn't seen Rho Aias yet (not even when Archer used it).
According to the World Material FAQs from fate/complete material III with Nasu (p.130) reated to the VN:
Q: In the end of the Rin route, was it Shirou that projected Rho Aias in the Shirou vs Gilgamesh fight? Or was it Archer? In Fate/side material, it's said that it was projection magic from Archer, but in the story, there was the depiction of Shirou "pulling the shield from the hill". Does this mean that this switched to Archer's scene?
A: This has been easy to misunderstand, but the part about Archer supporting Shirou was the time before Shirou pulled out Rho Aias, before Shirou came to his realization.
After Shirou's monologue about his surprise that he was still alive after taking Gil's attack, "If I survived, there must have been a reason why I survived. But that was simply something I didn't have any control over."
That was the "Rho Aias" that Archer made to help Shirou in a way that wouldn't let Gilgamesh know there was someone else waiting to ambush him.
In other words, the first Rho Aias that defended him (as he was chanting UBW, it's difficult to project something like that at the same time) against Enuma Elish was project by Archer (EMIYA).
The original has 7 petals, this one has 5 in the 2015 ufotable anime.
The second one inside UBW was probably one copied from Archer's version (perhaps drawing from the experience that flowed into Shiro as they clashed). It's not clear how many petals was in this version (likely 4 petals, like in the Heaven's Feel path). This part was never really clarified, but you can compare it to Kuro's projection of it using the Archer Class Card from Prisma Illya.
Note that against Lancer, Archer had to muster almost all of his prana to project a 7-petal version. Since he didn't have the prana for another 7-petal projection, he probably summoned a lesser projection in order to protect the Shirou and what reserves he had left.
Rho Aias not being a sword (being a shield), is going to cost more prana to summon. Since the UBW reality marble was not up, it's unlikely that Shirou had the means to to summon it at the time. So it's more likely that it came from an external entity (Archer).
The Fate/side material encyclopedia on Rho Aias (p.78-79) states that:
The Rho Aias that protected Shirou's spellcasting during the finale of the Rin route was not something he projected himself, but was actually made by Archer who was watching the battle from a distance.
Shirou mentioned that he was able to project it by pulling it out of the "hill of swords." This is likely a metaphor that refers to his reality marble (a materialization of one's inner self) or the collective of Archer memories, and not a literal hill.
To give you a proper answer to this question, Archer stated during his battle with Shirou that he had heard of magecraft that allowed mastery of skills by invoking them from a previous life and letting them possess them, and that every time they crossed swords, Shirou's skill kept improving.
The proof to this theory would be when Archer next charges him and showed his past self, his future, and the path he'd be taking. That would explain how he learned to fight and use the Rho Aias.
In F/SN:UBW season 2, they revealed that Archer's true identity is Hero Emiya Shirou - the MC's future self.
Archer regrets that he became a hero, so he tried to kill the current Shirou (Archer's past self). When Archer used UBW to try to kill Shirou, the MC copied it using the 'trace-on' thingy so all the things inside the UBW was copied. I believe it includes the Rho Aias.