The good news here, is that many countries have double taxation treaties. So that you don't get taxed by 2 countries for the same income.
https://en.wikipedia.org/wiki/Tax_treaty
Only to a point. I think the limit is around $100,000.00 nowadays. Anything over that gets taxed by both the country you live in and the U.S. (if you're a U.S. citizen).