this gets touched on further in Boruto, but in Naruto, a half-true explanation is given, that is that the rinnegan is created when you recreate Hagaromo's chakra.
Asura and Indra both possess two halves of Hagaromo's power, his dojutsu and his physical power respectively, these powers were later inherited by the two clans, Senju and Uchiha.
However, the Senju and Uchiha only have very diluted bits of Asura and Indura's power after generations of children dulling Hagaromo's Otsutsuki DNA and power.
so the only people in the series who have awakened Rinnegan were people who got both halves of Hagaromo through being Asura and Indra's reincarnations
- Madara(Indura) bit off a piece of Hashirama(Asura) during their fight and added Hashirama's powerful chakra to himself eventually awakening the Rinnegan years later.
- Sasuke(Indura) after being almost killed was implanted with Hashirama(Asura) Cells by Kabuto to save him, which allowed him to awaken the rinnegan.
you might have missed it but a while back, when Obito's mask got blown off, Madara explained that he gave Nagato his Rinnegan, Nagato ain't awaken shit.
MS yeah, EMS, we only know of two.
you did go through a lot of content pretty fast, and the anime is a bit ehh sometimes.