he had obito.
OT: both apparently.
In all fairness!.. Obito didn't teach him anything because he had never wielded that doujutsu before.. Telling him is not the same as helping him when he didn't know himself.. All Obito did was play on his emotions while recording the outcome (6paths)
Hell to be even fairer, Madara didn't know too much about the Rinne because he gave it up after summoning the Mazou.. (He didn't master the Rinne just used it's most powerful jutsu.. Summoning the Mzou then passed it on)
There's to many holes in this series to know exactly.. (I'll give you1 an i'll leave this alone)
Nagato who the story tells us that he is not the original owner of his doujutsu could regenerated himself off of KB's V2 cloak an was at full health an stamina while Madara who supposedly awaken the Rinne himself couldn't do the same as an ole man is a hole that is unexplained an makes no since..