It sounds like your friend isn’t a tourist if he is trying to stay in Thailand for such lengthy spells. Immigration are starting to get stricter with this.
Why does he not just apply for a DTV. He can get stamped for 6 months every time he flys into Thailand and can come and go for 5 years.
Write yourself an employment contract and ensure you put in, and highlight, a specific sections that says your work place is online and you have permission from the business to work remotely from any country, on the provision you obey the laws of your current country