It's pretty self explanatory on pages 16 and 17, he knows the original contract, I'm starting to think that Madara killed Tobirama, but before that he made Tobirama tell him about Edo tensei Using Genjtutsu.
There are a lot of ways that Madara could have learned the secrets of Edo Tensei. Keep in mind that the Uchiha and the Senju frequently fought against each other for a period of many years. During that time, it seems very likely that they would have each seen the other's attacks and would have done some research about them.
In battle, Madara had probably seen Edo Tensei used up close, and would have seen the kinds of strategy and limitations in mind from the original creator. Kabuto had done a lot of improve the seals and bindings of Edo Tensei, but Tobirama had the original idea. He had an idea and pursued it to create the original jutsu, so he probably had more insight into the technique and its purposes than Kabuto does. Notice how the first thing Madara does when he comes to the battlefield is to summon a meteor onto the allies AND himself. Madara knows that Edo Tensei is a technique that allows the user to use a suicide technique and survive anyway.
During all the years that the Senju and the Uchiha fought, it's stupid to thinki that Madara only fought Hashirama. Sure that's the match up that gets the most attention, but Madara would have fought with other Senju too. Tobirama is a powerful ninja who certainly would have crossed paths with Madara many times.
And when the fighting was over, they were allies and probably learned even more secrets from each other.
My point is: Kabuto is the farmer who learned to take the Edo Tensei seed and grow a large plant with it, but Tobirama was the scientist who genetically programmed the seed in the first place. Madara learned about the technique from the master, and saw the original purposes of it. Plus, he also knew about the limitations and risks of the techniques, because Tobirama was a smart guy and would have known these things. If you're a smart guy and, arguably, a good guy, you don't start sacrificing humans until you know what the benefits and limitations are to the technique.
I've said in many posts before, there are a million ways that Madara could have stayed on the battlefield. Madara has Rinnegan (which can resurrect the dead), Tobi has Rinnegan, Kabuto is still alive to re-summon Madara, and Madara himself knows about the Edo Tensei. It would have been more surprising if Madara DID NOT stay after Edo Tensei was released.