How can we repatriate the funds?
The Central Bank [Bank of Thailand] requires some paperwork before funds can be transferred outside of Thailand. Generally a purpose of remittance is required. See the below from Bangkok Bank website
The maximum amount you can transfer out of Thailand is determined by the Bank of Thailand, depending on the source of funds and/or the purpose of payment, including supporting documents. For example, if you are a foreigner repatriating proceeds from the sale of a condominium, then you would need to submit the purchase and sales contract and ownership title documents. In this case, the maximum transfer amount would be the selling price for the condominium.
Regardless of how much is transferred, the Bank of Thailand requires
senders to specify in their payment instruction the purpose of the
payment (Thai residents) or the source of the income (for foreigners),
as well as present any supporting documents.
It is advisable to contact your Bank in Thailand to understand the formalities, take help of qualified CA as required. The funds can be transferred using international wire transfer.
What is the tax liability?
From Thailand taxation point of view the capital gains are clubbed along with income. These can also be filed separately with indexation benefits. Best take the advise of local CA who can guide you.