Mainly if other countries believe it is a country and treat it as a country. You can look at Taiwan as an example. For all intents and purposes, it acts as a country. Yet, almost all countries do not classify Taiwan as a country, so it isn't really a country.
In modern days, recognition of being a country is generally handled by the UN as it is an organization of countries which recognize each other.