5 turns with no damage = stalemate, the attacking armies withdraw with 0 movement points.
To be verified, but its seems it is more exactly "X turns (5 you said, may be this) during
the attacker do not give damage" = slatemate.
I just experienced a fight where only defender do damage to the attacker, and fight ended as a withdraw.
The situation is : attacker as AI with hero alone (after a big fight) with big regeneration, but defenders regrouped near defense turret with 2 units.
Each time attacker approach, he was damaged by the long range unit, and then go back to regen.
I think if he approach it could be killed, but i'm not sure.
It's the fist time i saw AI unit go back to avoid damage,
In every fight AI can do that but when life unit is near 0; it was not.