Most countries tax people who are resident there, using their own definition of residence. Living in one country while earning from another can mean two authorities are interested in the same income.
Because those rules differ everywhere and change over time, Abiora points you to the official authority instead of stating a rule that may not apply to your situation.