In Naruto Shippuden, Nagato had his Rinnegan during the 2nd Shinobi war. However, it is said Madara implanted his Rinnegan in Nagato right before his death, but Madara’s death was during or after the 3rd Shinobi war.
So how did Nagato have his eyes before Madara’s death during the 2nd Shinobi war? I’m confused with the timeline of when he actually got the Rinnegan.