In general, you become a tax resident of a country if, according to that country’s laws, you are required to pay taxes due to your domicile or residence, and not solely based on income generated in that country.
Example: If a person lives in France but works in Luxembourg and returns home to France every day, they will be considered a tax resident of France, and not of Luxembourg.