Complex sentence: Athletes from 21 countries won medals, leaving two countries, Andorra and Lebanon, without a medal, and 18 of them won at least one gold medal.
Split into simpler sentences: Athletes from 21 countries won medals, leaving two countries, Andorra and Lebanon, without a medal. Among the medalling countries, 18 of them won at least one gold medal.