Complex sentence: In 1049, when Aedh O'Connor defeated Amalgaid ua Flaithbertaigh, King of Iar Connacht, the O'Connor Kings became Kings of all Connacht, O'Connor built a castle at Tuam and made it his principal stronghold.
Split into simpler sentences: In 1049, when Aedh O'Connor defeated Amalgaid ua Flaithbertaigh, King of Iar Connacht, the O'Connor Kings became Kings of all Connacht. O'Connor then built a castle at Tuam and made it his principal stronghold.