I've played through a whole truckload of HoMM in recent time, so...
Number 3 is the best hands down. It's an upgrade over 2 in pretty much every possible way, except for one, which is no non-linearity in campaigns (HoMM2 had some optional side missions that would give you bonuses for each mission onward, like an alliance with dwarves that would make all dwarves on the map join your army when encountered). It's got the most varied campaigns, great visuals that aged VERY well, and two expansions that both offer different stuff and should be played.
Number 2 is also very good, but as I said, HoMM3 simply did many things better. Still, definitely worth playing.
Number 1 I actually haven't played for some strange reason, so I can't comment.
Now, number 4... this one is tricky. I actually liked it a lot, it's not as horribad as people will make you think - it wasn't an "inherently flawed" or broken game, it simply did things different, diverged a lot from the general HoMM formula that ran HoMM 2 and 3. But, on its own, it was still really good. It balanced the "magic" part of the game, significantly nerfing max level magic from being TOTAL FACEROLL OVERKILL and upping the combat presence of warrior heroes, it had *THE* best soundtrack in the entire series, offered some interesting interplay/alliances between factions that allowed mixing different castle units without killing morale, had the best writing in the campaigns (although nobody should really give a damn about this), implemented caravans travelling between cities and monsters nests which was quite possibly the BEST THING EVER to happen to the series, and put in some changes into the way battles were fought, which, personally, I think were better, such as ranged counterattacks for archers, creatures attacking themselves at the same time (which prevented 'lul let's wait for them to come close so I can have first attack' cheese), and giving some creatures whole spellbooks. The bad parts of HoMM 4, however, are no upgrades for units and the need to choose between creature x or y for ever tier, when some of those were CLEARLY superior (why would anyone take minotaurs over medusae is completely beyond me, for example). It also had a way more... "fairy tale-ish" graphics style, which could be off-putting at times, and clearly a decline from the previous parts. It also had horribly repetitive campaigns - each one basically goes the same way: CIVIL WAR RAGES, YOUR MAIN D00D BECOMES HEROKING, IN ALL SCENARIOS YOU FIGHT THE SAME FACTIONS YOU PLAY, OMG BETRAYAL, VICTORY, LIVE HAPPILY EVER AFTER. It simply gets tiring that scenario after scenario after scenario you keep fighting the very same creatures you are controlling, not using some of the pretty obvious "counters" that some factions are to one another. It also has some seriously questionable decisions, such as putting a bordergate right next to your starting location, with a fuckhueg enemy town right behind it... but of course only the enemy can pass through it since the keymaster's tent is on his side. All in all, though, HoMM4 is, I think, a generally solid game, and at least worth a longer try just to see for yourself.
HoMM5 I'm currently in the middle of playing 'cause I only played it when it first came out and ditched it pretty fast. I'm thinking of doing the very same thing now because the entire first campaign is just ATROCIOUS. Whoever thought making AN ENTIRE BLOODY CAMPAIGN A FUCKLONG TUTORIAL should be hung by the balls. Still, #5 was basically a return to the #3 formula, with some ideas borrowed from #4 (such as spellbooks for certain creatures [AND IT MANAGED TO MAKE IT COMPLETELY FUCKING BROKEN], expanded hero customisation, etc), so, on paper, it is sorta solid. But I gotta play more of it to see for myself, though people often say the vanilla campaigns are kinda bad, and the custom missions are small as hell.
Also, remember, there is no such thing as HoMM6.
But, trust me, you are far better off playing King's Bounty: Crossworlds
Darth Roxor rates this post as Optimistic.