This is not exactly correct, R.
Heavily simplified:
Most countries tax all your income, regardless of its source being domestic or foreign, if you are resident. Tax treaties usually ensure you don't pay double tax.
When you give up residency you will ditch the obligation to pay tax on...