For the tax matter, keeping profit in low-tax country is just the first step. How to send profit back to your home country and spend it legally is another story and generally it is different for each country. Developed countries have more power to control their citizens but many developing countries cannot (or even don't care). So you can setup offshore structures like many people are doing, but also need to understand the taxation policies in your home country as well