Generally, it is countries that act as a buffer state between great-powers that remain uninvaded. Two perfect examples of this are. 1) Mongolia - between USSR and China. 2) Nepal - between British East India and China. Other than this there are very few to no countries that have never been ruled by foreigners.