The game isn’t very well explained, that’s true. I think the first mission should mention how this works, but I’m not sure. Anyway, unit will counterattack once, if it has any AP remaining, and survives the initial attack on it. This means that, for example, infantry can’t counterattack tanks, as it will always die from the attack. Tanks can’t attack (and counterattack) helis at all. Performing a counterattack will drain the remaining AP, so it can only happen once. Hope that helps!