Complex sentence: The Spartans held out but Dexagoridas decided to surrender the city to the Roman legate but when Gorgopas found out he killed his fellow commander and took solo command of the city.
Split into simpler sentences: The Spartans held out but one of the joint commanders, Dexagoridas, decided to surrender the city to the Roman legate. When Gorgopas, the other commander, found out he killed Dexagoridas and took solo command of the city.