As houses consist of a structure based upon the land and since an individual foreigner is prohibited to own land in Thailand, they are not able to own that property. There are several ways in order to have rights to the structure upon the land without having to own the land itself.
Land in Thailand is measured in Rai which is approximately 0.395 acres. There are different types of land title deeds in Thailand ranging from possessory title to freehold title. Houses also come in different forms ranging from Villas, apartments and townhouses.
Please see Thailand Title Deeds
One way to have rights over a structure based upon the land would be through a lease agreement in which in individual leases the land from a Thai national for a certain period of time. This provides you with a legal right to reside and possess the property.
Please see more on Leases
You may also choose to settle with a mortgage agreement between you and your partner, or a Thai national, in which a mortgage is placed as an encumbrance on the land, and you will be able to reside on the property so long as it is agreed upon by the owner, however, the legal right in which is obtained from such a transaction is a right of mortgagor in order to prevent the registered owner from being able to sell the property in which the house is based on, hence protecting your interests.
It is essential to bear in mind that if you wish to register either a lease or a mortgage between you and a Thai national who is a Thai partner and you have registered your marriage, that the land department will refuse such registration as the property is then deemed matrimonial property.