Basically there are "на-words" and "в-words" in Russian. It is not only about countries. There are some rules to put these words in groups and memorize but they aren't absolute and aren't always clear as often require in-depth knowledge of word history.

As for countries, yes, most islands are "на-words" and most other countries are "в-words".

на Мальте = in Malta; на Мальту = to Malta
в Италии = in Italy; в Италию = to Italy

See also this.