You need to activate Izanagi before getting killed.
He was still alive since he was thinking. You don't need to activate it before the damage happens, that wasn't stated anywhere, Danzo and Obito just had to do that because they wouldn't have the time do activate if afterwards since the attacks would have killed them instantly. But Madara was still there for a short while, he had the time to activate.
i don't think Madara had any time to react to using Izanagi... the manga always makes it look so slow... though the process can be really fast. perhaps Madara was taken over pretty quickly... as well as all the chakra that blasted inside of him made him unable to control it... and probably use it too
edit; he had rinnegan activated when stabbed, thus making him unable to use Izanagi in time...
you need to activate it before the lethal blow hits you...
True but he trashed Minato and Tobirama, and since he and Naruto + Sasuke had the time to talk I suppose that Kaguya was slower than Minato or Tobirama.
And he could have just switched to EMS/MS, thats almost instant.
You need to be on brink of death. And plus you need a Sharigan.
He had.
This really smells like PNJ to me.