it would be the first question you would ask when buying a condo. As mentioned above the jurisdiction of the building keeps track of foreign ownership. You would double check this with the Land Department. Once you have purchased as foreigner you can then sell with foreign ownership.
You are correct you cannot own land as foreign individual's, however, you can own condo outright provided the block does not have more than 49% foreignownership. We have owned a condo in Bangkok for over 11 years now. Please feel free to dm me should you have any further questions.