a person who (unlawfully) occupies unused land acquires ownership rights by holding the property for a specific period of time (see section 1382 below). Squatters' rights in Thailand depend in the length of (adverse) possession and type of land title (land with a full ownership deed or mere possession rights)
Section 1382. Where a person has, for an uninterrupted period of ten years in case of an immovable peacefully and openly possessed a property belonging to another, with the intention to be its owner, he acquires the ownership of it.
The links below contain relevant provisions: