Complex sentence: The teams were divided in five groups of four teams each and the matches were played in two legs.
Split into simpler sentences: The teams were divided in five groups of four teams each. The matches were played in two legs.