Complex sentence: When the Austrian army entered the ambush, the Confederates attacked from above with rocks, logs and halberds, the knights had no room to defend themselves and suffered a crushing defeat, while the foot soldiers in the rear fled back to the city of Zug.
Split into simpler sentences: When the Austrian army entered the ambush, the Confederates attacked from above with rocks, logs and halberds. The knights had no room to defend themselves and suffered a crushing defeat, while the foot soldiers in the rear fled back to the city of Zug.