As was explained in chapter 606, pages 13 and 14:
Those who have both Uchiha and Senju DNA (which allows you to awaken the Rinnegan) can summon the Gedo Mazo.
Only four people have been able to do such: The Sage of Six Paths, Uchiha Madara (Second Rikudo), Nagato (Third Rikudo) and Uchiha Obito.
All four of them possessed both DNAs and the Rinnegan:
- The Sage of Six Paths is the person from whom both lineages descend, possessing both DNAs, as well as the Rinnegan.
- Uchiha Madara possesses Uchiha DNA naturally, and transplanted Senju Hashirama's cells into his wounds, awakening the Rinnegan when he was at the verge of death.
- Nagato is a descendant of the Uzumaki clan, who are related to the Senju clan, thus possessing Senju DNA. Madara transplanted his Rinnegan to him when he was very young. With this, not only did he gain the Rinnegan, but he also had Uchiha DNA implanted into him.
- Uchiha Obito naturally possesses Uchiha DNA, and had Senju DNA implanted in him when Madara fused a Zetsu clone with his body to save him. However, he did not awaken the Rinnegan, but rather had Nagato's (which was actually Madara's) Rinnegan implanted.
According to Madara, he unlocked the seal to summon the Gedo Mazo upon the time of his Rinnegan's awakening.