Common sense would give you an answer in two and a bit words: He can't.

But this is a manga and it's the title characters fight, he ain't loosing/dying. Anything could happen but in the end the Leaf will have avoided destruction and most/all main characters will be alive. Gods puppets will somehow have died(somehow but probably not all) but his original will still be somewhere.