That's not true, and it's often not well known, but your own physical location is also a factor, not only your source of income. Most countries would never detect this anyways, but you shouldn't think that it's legal at all.
Well then I guess the lawyers I hired in country were all lying to me? As long as I didn't overstay my visa, didn't stay more than the required time for physical presence test tax liability (typically 180 days), and didn't work for firms inside the country, I was legit.
Please let me know if I was given bad legal advice, because I don't want to get thrown in jail in the future.
If they told you the legal advice they were giving you for a specific country was valid in all countries, and that all countries treated this income the same way, then yes, they lied to you.
Please let me know if I was given bad legal advice, because I don't want to get thrown in jail in the future.