If you purchase a house and live in it for 2 years as your primary residence, there is no tax penalty...you can take the first $250,000 if your single or $500,000 if your married capital gains tax free, over the original cost basis.
So...if you purchase a house at $400,000, that is your cost basis. If your house has a substantial increase in value, and you sell it, let's say for $800,000, and your married, then you have a capital gains of $400,000, in which you can take out tax free.
Now, if you have sold a property that is not your primary residence, and is an income property, and you make over $200,000, then you may be subject to capital gains tax and also the new 3.8% Medicare Tax. I suggest you check with your accountant to get more information.
If your property is an income property, then there is a 1031 exchange that you may want to do, which you would need to identify a new like for like property to purchase during the escrow period.
I suggest strongly that you check with your accountant to discuss your tax liabilities.
All the best,