Use your knuckles, with both hands next to each other, from left to right Jan - Dec. Each 'hump' has 31 days.
1 - 3 lines of the rhyme at the end are utterly pointless as it's much easier to just remember that leap years are actually a thing.
2 - The fact that it rhymes doesn't help you remember which months you're talking about. It could quite easily be, "30 days hath September; October, November, December" and it would still rhyme but be wrong.
I was taught:
Thirty Days has September,
April, June and November.
All the rest have Thirty One;
Except February, it's a different one!