naruto and sasuke fight, sasuke loses, madara shows up and tries to kill sasuke after naruto changes him to a good guy, madara either gets hit by kakashi using his mangekyo sharingan, lightning blade, or either naruto gets back up in sage mode and protects sasuke by using that special punch that looks like it doesnt hit but then it does.
after that sasuke will be a good guy, and then they will defeat madara together. kabuto will fall back from the battle when he see's madara losing, then sasuke and naruto will hit madara at the same time basically sandwiching him with resengan and chidori... as the attack is hitting him, sasukes chidori starts to cut through madara and hits naruto's resengan and it causes a massive blast wave which destroys madara by sending him into pieces.