try to stomp on his head in the first phase then he will start spinning in his shell in his second phase then for a final attack he will shoot bullet bills at you WHILE hes in his shell (for that phase you just dodge and he will eventully go away) WARNING EXTREMLEY HARD (I beat it after 12 tries)
credits to google for pictures nintendo for inventing mario and me for code please give feedback check out this one its a lot better https://scratch.mit.edu/projects/441636018