Any time kids at my school were in a race to get somewhere, the winner would be taken down a peg with the following:
"First is the worst,
second's the best
third is a nerd
in the polka dot dress"
A few years later, when my little sister learned it, her friends had changed the last couple of lines to "third is the BEST in the polka dot dress" (the fact that second was already the best didn't bother her in the slightest, no matter what I said). The person who came in first would, before anyone could claim otherwise, recite the rhyme starting with "Zero's the hero." This line was unknown to me until my sister and her friends started using it.
She and her friends didn't invent this, of course; even the "zero's the hero" bit has been going around for years. The "third" in other versions was often "the hairy princess" or "the one with the hairy chest."
Some appear to have gone even further, adding in "fourth is the king, fifth is the queen, sixth is the one in the washing machine. And, of course, there are LOTS of variations in the comments. Really, the comments to this one have gotten absolutely out of control.
As to how old it is, well... one version appears in a book of “New England Sayings” from 1894, and in a magazine from 1879:
First’s the worse
second’s the same
last’s the best
of all the game
A similar rhyme is presented as an old saying in Faith Gartney's Girlhood, an 1872 book in which a character complains that her sister "plagues" her with the rhyme, changing it up to make either the first or last be the best, depending on which of the two of them finishes dressing first.
However, in the voluminous comments to this entry, we can see that many variations became widely known in the English-speaking world, including variations about "the golden eagle" and "the hair princess" and various classifications that don't even rhyme. Many of them never appeared in print, as far as I can tell. This is one that probably is strictly on the playground; many of the songs and rhymes on this site probably got started in the military or on college campuses and filtered down. Most of these variations were probably made up by kids and spread by kids, but spread internationally by word of mouth alone.
Many of the commentors declined to leave the date range / location where they heard their version, and aren't that useful for research (some others are probably just making something up) (I do get a few people on this site who just reply by making up 20 rude "Obama" versions of any given rhyme). Sometimes on the site if I suspect someone is just mouthing off, or if they leave out the relevant info, I won't publish the comment. This one, though, I just sort of let run loose.
See more in the ebook: