Typically:
The country where you are tax resident will want to tax you on worldwide income; and this according to its local (tax) legislation.
Many countries will want to tax you on the money earned while working from that country.
In many cases of DTT you will get “credit” in your tax-resident country for taxes paid in other countries.
Many us states/countries will want to tax you for your earnings while working from the state/countries.
Based on a number of criteria some will consider you tax resident. They will want to tax you on your worldwide income. You would typically get ‘credit’ for taxes already paid elsewhere.
If you are US or Eritrean citizen your country of citizenship also require you to submit a tax return.
Please note that the us and many other countries require a work permit or citizenship to be able to work legally in/from their territories.