180 days with a salary threshold and country restrictions, or 90 days pretending to be a tourist. I know which I'd choose.
Pretending to be a tourist is a good way to get deported usually in a lot of places.
If you are a tourist who works for a foreign company while visiting a country, well I don't know a single person who has been actually deported for this. I know it can happen, but most places seem to not care much, and mostly care you're spending your money in their country.
I am a digital nomad myself for about 1/2 every year so I do have my biases though.