I can't speak to selling foreign real estate, but I can tell you that as a USA citizen, if you operate an S.A. (sociedad anonima) in Costa Rica, you may be liable to report it on Form 5471, or else face a $10,000 per year fine. There is also very little chance of getting a break on the fine unless you have an extreme circumstance.
Form 5471 is for anyone who owns or holds shares in a foreign corporation. I lived in a $500/month apartment for 6 years and used a local S.A. to operate as a sole proprietor. Taxes were paid to Costa Rica Minesterio de Hacienda and to the USA IRS.
Unfortunately, while I reported foreign income, I did NOT report owning a foreign corporation. I thought owning a foreign corporation meant holding stock in some enormous business, trading financial instruments, or some company with a multi-national presence.
Apparently a S.A. used to earn a middle-class income is supposed to be reported or else you get fine $10,000 a year for any delinquent forms.
If you're using YOUR own S.A. for your real estate transaction (meaning a Costa Rica business you own yourself or operate independently), and the purchase is significant, you should probably consult a USA Tax attorney about Form 5471.
1. FBAR forms - Foreign Bank Accounts. If you have a signature on file with a bank in Costa Rica for personal or business banking, and the combined balances of your accounts at ANY point during the calendar year exeeds $10,000 all bank accounts must be reported. The $10,000 combined balance includes accounts in other countries not including the USA. For example, if you have accounts in Cost Rica, Europe, Hong Kong, and Panama, all must be reported if the total amount "offshore" is $10,000 or greater.
Your real estate transaction would apply.
2. FATCA assets form - The USA has made an agreement with Costa Rica regarding USA citizens with substantial offshore assets. If those assets exceed $50,000 (not sure exactly on the figure, check the IRS.gov site) you must also fill out a FATCA form disclosing those numbers.
So when you sell the house in 3 years for $150,000 USD and that money goes to your local Costa Rica bank account, you're on the hook to report on a third form.
Talk to USA offshore tax lawyer, even if they charge a high fee for a brief consultation. My delinquent FBARs and 5471s could wipe me out completely. $300-$500 for a hour of a lawyer's time in the USA is money well spent.
Do NOT use a local Costa Rica lawyer for anything but local Costa Rica business law and local taxes.