Using 'the' for a country name is a bit unpredictable.
As a guideline, country names that describe a physical geographic feature use 'the'. A group of islands, a river, or a mountain rage. For comparison, think of other geographical features such as the Sahara or the Amazon. Country names that describe a political features also use 'the'. This is usually a republic, or a political union - The United Kingdom or The United States of America.
The unpredictability comes when geographic or political features are unclear or forgotten. Lebanon is named after a mountain range, Sudan after a desert, Gambia after a river, and Ukraine = 'borderland', but none of those normally use a definite article.