A reader recently asked me to look at the hydra, but the hydra isn’t a particularly complicated monster. A straightforward brute, with extraordinary Strength and Constitution, it’s extremely stupid and not discriminating when it comes to target selection. It also has only one method of attack: one bite for each of its multiple heads, of which it initially has five.
Running a hydra encounter is primarily a matter of accounting: tracking how much damage has been done to it; whether any of that was fire damage; and how many heads it has at the moment, since (a) destroying one head without cauterizing it causes two to sprout back in its place, and (b) it gets an additional opportunity attack for every extra head.
The only question you have to answer, round by round, is where the hydra is going to position itself, and the answer is, wherever it can attack as many targets as possible, up to the number of heads it has. In other words, if possible, a five-headed hydra will try to position itself where it can reach five targets; a seven-headed hydra will go where it can attack as many as possible, up to seven; and so on. It doesn’t have to be immediately adjacent to these targets, since its heads have a reach of 10 feet: a target is still within reach if there’s a single square or hex between the target and the hydra, even if there’s another creature in that square or hex. (Because of the hydra’s size, an interposed Medium-size ally doesn’t give a humanoid creature any cover.)
It’s not smart enough to avoid opportunity attacks, so a hydra will begin its turn by moving to the optimal attacking location within 30 feet, then attack with every head. It attacks every opponent within reach with one head, and if it has one or more heads left over, it attacks its biggest opponent one more time, then its second-biggest opponent, and so on. Exception: Anytime an enemy does enough damage to cut off one of its heads, if two grow back in its place, both of those heads attack that enemy.
Hydras have advantage on saving throws against a variety of conditions, and as repeatedly noted, they’re morons, so they don’t know a spellcaster from any other walking Slim Jim, nor can they tell a magic weapon from any other kind of weapon except by how much it hurts.
A hydra is seriously wounded when it’s reduced to 68 hp or fewer, at which point it doesn’t flee, exactly, but it does retreat. It uses the Disengage action—not as a thoughtful tactic but as an instinct, snapping and feinting at its enemies with its jaws—and backs away to the nearest body of water. Upon reaching water, it dives and swims away.