By being present in a country for 180 days in one year every year for 5 consecutive years. Or if the above fails to determine it then it is where you have a home available to you. Where you return to after your wanderings. Or if the above fails then it is where your centre of life is. Or if it cannot be determined by the above then you will be considered tax resident in your country of citizenship. The tax authorities WILL find you tax resident in some country. You cannot escape it. It is also important to check the tax agreement between your 2 countries to find where you are taxed for different types of income. Some income such as state pension is taxed only at source. Capital Gains on fixed property is only taxed where the property is situated. Capital Gains on movable property such as shares are only taxed by the country of residency.