None, you can’t live *legally* in a place without being a resident.
I must respectfully disagree with your perspective since there are exceptions.
Living in a country typically refers to the state of residing within a specific geographical and political territory that is recognized as a sovereign nation or state. Let's disregard legal residency for one moment since you might still have a legal basis to stay in the country (e.g. if you are in prison).
According to domestic legislation, most jurisdictions consider you a tax resident if you stay there >183 days. Still, for EU citizens, it is, in some cases not enforced if they don't register their place of residence in the same jurisdiction.
It might not necessarily even be illegal. As an example, Americans can live 365 days on a visa in Estonia and work full time, and in such cases, it's actually impossible for them to get an Estonian tax residence certificate while reaping the benefits of a GILTI-free structure.
This is because Estonia would consider a double tax treaty in determining the tax residence of such persons in case of potential dual residence.
People staying in the country with a visa can't register their place of residence (which automatically means they can't get tax residency) and are not considered as living in the country, and nobody really bothers them. You might still have a legal right to work - e.g., it is an often underestimated benefit of a digital nomad visa.
The same applies to specific investor residence permits where you don't have to register your place of residence. You have a right to live, yet you don't have a place of residence.
Your place of residence and centre of vital interests is in the other jurisdiction where you want to be a tax resident. The centre of vital interests is deemed to have arisen in the country with which a person has more personal and economic ties (e.g. family and social relationships, workplace, political or cultural activities, etc.). Consider UAE for example.
There are some living examples who have done this for 10+ years.
This is in general tricky topic so I would advise carefully planning this with immigration and tax advisers.