World of Dreams

is episode 346 of the Naruto: Shippūden anime.

Summary
Still in disbelief as Obito walks over towards Rin's body after slaughtering the Kiri-nin while ignoring the unconscious Kakashi, Obito remembers Madara and White Zetsu's words as he cradled her lifeless form while vowing to change the world into one where she is still alive. After returning to Madara, as the elder Uchiha expected, Obito accepts becoming his apprentice. From there, Madara uses his genjutsu to tell Obito the legend of the Sage of the Six Paths and the Ten-Tails. After teaching Obito the means to summon the Demonic Statue of the Outer Path along with imparting all his skill and knowledge, Madara uses a Yin-Yang Release ability on White Zetsu to infuse the clone with his will, completing Zetsu with the birth of Black Zetsu. After disconnecting himself from the Demonic Statue of the Outer Path, Madara finally dies telling Obito that he will be Madara until the day he is to be resurrected by the one he transplanted his eyes into: Nagato. Soon after, now going by the name Madara Uchiha with White and Black Zetsu accompanying him, Obito arrives in Amegakure where he meets Nagato and his friends. Though Obito tempts Nagato with his knowledge and offers to aid him in achieving peace, Yahiko gets his friend and Konan away. Despite being warned by Yahiko to stay away, Obito tells Nagato that he would reappear at the same time and place everyday until he accepts the truth of words. Soon after saving orphans and gaining a new member of their growing group, Yahiko decides to name their group Akatsuki.