First off, they get free actions even if they're stunned or dominated. This becomes important later.
Second, they start with 4 heads but lose one at each 25% of max hp damage. However, if the PCs then don't hit the hydra with a certain damage type (and it changes with the different hydras), 2...