"Ninshū: The Ninja Creed" (忍宗, Ninshū) is episode 464 of the Naruto: Shippūden anime.
Hagoromo explains to the four Hokage that Naruto and Sasuke are his sons' reincarnations, and that they're battling his mother. So the four can fully understand the situation, Hagoromo explains the origins of Ninshū. After Kaguya was sealed, Hagoromo began wandering the world, to restore the land ravaged by the fight against the Ten-Tails, and to find homes for the tailed beasts. Gamamaru gives Hagoromo another prophecy, about the tailed beasts and a "blue-eyed youth" and bids him farewell. Hagoromo comes across a broken bridge, and decides to repair it, against the protests of Futami, a thief who uses the broken bridge to scam and steal from people. Hagoromo warns a would-be victim about him, enraging him. After days watching Hagoromo restoring the bridge, Futami himself starts to help, so Hagoromo can leave sooner, intending to destroy the restored bridge again after he leaves. Seeing the two rebuilding the bridge, others begin to help. After the bridge is done, Futami leaves with Hagoromo, having changed his way. After getting to know each other more, Hagoromo shares his chakra with Futami, who asks to become his apprentice. Hagoromo discovers another purpose for his journey, bonding people through chakra. The two come across another broken bridge, with another thief, and the situation repeats itself. Hagoromo begins amassing more followers, and finds places where he could release the tailed beasts. Hagoromo's followers scatter, spreading Ninshū across the world. On his deathbed, Hagoromo releases the tailed beasts to the places he found. After his journey was done, Hagoromo returned to the Land of Ancestors, where he married and had two children, though his wife passed away after giving birth to Asura. Unnoticed by Hagoromo, Black Zetsu set his sights on his sons.