Understand but I personally haven't been there in that specific scenario i.e. assessing the merits of being a tax resident to avoid CGT! My life is not that complicated fortunately!! 😀
it is taxable if remitted into Thailand. It depends on your circumstances regarding the original country. I am in Thailand for more than 180 days but also still a tax resident in the UK and do a tax return. The tax I pay there is offset against my liability in Thailand based on the treaty between the 2 countries.