Thirty days has September,
April, June, and November,
All the rest have thirty-one except February,
Which has four and twenty-four,
'til leap year gives it one day more.
Yes, this is the way I remember. My wife quotes the rhyme and I annoy her by pointing out the following issues:
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.