Elder son believed that power was the key to peace, later on he awakened Sharingan.
Younger son believed in love to achieve peace, he ended up having sage eyes.
Madara Uchiha is from the bloodline of elder son and Hashirama Senju is from the bloodline of younger son.
Rinnegan is natural successor to Sharingan, it can only be obtained if you have both the powers of Uchiha and Senju, which means the powers of Sage of 6 Paths.
How did Madara awaken the Rinnegan?
Madara Uchiha awakened the Rinnegan prior to his death, in the fight between Hashirama and Madara , Madara lost but he gained a portion of Hashirama's power in return , since he had both the powers , he could awaken the Rinnegan.
How Nagato had the Rinnegan?
Obito transplanted the Rinnegan into Nagato, which was from Madara.
If you have any other questions relating to this topic, you can ask below