Foreigners can outright own a condominium in Thailand 100% freehold.
Imagine a building has 100 units. 51 of those units must be owned by Thai nationals. A maximum of 49 of those units can be owned 100% freehold by foreign nationals.
If a building’s foreign quota limit is reached, the only way to purchase a freehold condo at that building is to buy from a foreigner with an existing freehold title.
Alternatively the foreign national can choose to buy from a Thai national but only on a leasehold ownership.