Board Thread:Naruto Discussions/@comment-36221354-20180717114536/@comment-6769189-20180718033445

Its super complicated. Supposedly you only need Hagoromo's chakra, but only eyes capable of bearing a Sharingan have unlocked the Rinnegan.
 * Madara and Sasuke

BUT not all eyes that have obtained his chakra has changed
 * Naruto. People will tell its because Hagoromo chise to give Naruto and Sasuke certain abilities but it wasnt ever really confirmed that he did. He only ever said he was giving half his power to Sasuke and Naruto.
 * Obito. He may have not had enough exposure since he couldnt manifest the Rinnesharingan on his own and it took Madara some time to do so.

Then we have Momoshiki and Urashiki, one has a Rinnegan and the other has a Sharrinegan, but their clan eats and absorbs the power of other people so how they came to have their Rinnegan is such a huge tossup.