It does depend on what you mean by residency and why you want to know.
If you move to another country, you are resident there, and there may be a legal requirement to register with the local authorities.
However, this does not mean that you are domiciled there for legal or tax reasons.
You may need to be there for a length of time, before you can claim that you are a permanent resident of that country.
Depending on the country, different rules apply.