You are horribly misinformed. This is not how it works at all.
If you go to a foreign country and earn money, you still owe US federal tax.
If you go to Thailand and have sex with an underage prostitute, you will still go to jail when you return to the United States.
If you kill someone on a boat in international waters you still will be tried for murder.
Sorry, it usually does not matter where the deed takes place.
Frayed knot.

What you are describing is criminal overstepping of government authority outside of its jurisdiction.
What you've put forward is, sorry to say, complete and utter insanity. It would put everyone under every law, and everyone would be stoned to death. e.g. Why shouldn't you be subject to Shariah law? Other people are.
Well, the objection you (or someone else) will put up is, "Oh, but I'm not a citizen of XYZ." The underlying assumption there is that you are the property of whatever country you are from and have no self-ownership. i.e. You are a slave. I'm not going to bother putting in the effort to explain why because statists can't be reasoned with because they start with logical contradictions after which any absurd premise follows, e.g. it's ok for some people to be violent, but not others, etc. etc. The slave logic there holds.