If you are single or taxes are filed as individual you are allowed $250,000 tax exemption on the sale of your home if married or filing jointly you are allowed $500,000
If you are investor, and this is not your home, it based on tax year income.
If it is 1031 exchange you have 6 months.
You definitely should speak to your accountant about your specific tax situation
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,
Taxes are usually a very complex subject of discussion and most professionals want to shy away from discussing them due to liability concerns. You can email me or contact me outside of this forum and I may be able to give you further information.