There is a universal rule called 'step up' which means the second rank can attack, but only with one attack each regardless of how many they have, unless they are monstrous infantry (such as ogres, trolls ect).
Third and successive ranks can attack if:
The unit is in horde formation (10 wide, or 6 wide if monstrous infantry or monstrous cavalry), an extra rank can attack
The unit has spears
Or some other special rule.