If you were gifted the property (i.e. the donor is still living) then you assume the cost basis and holding period of the donor. For example, if your grandparents paid $10,000, 50 years ago for a property and then later gifted it to you when it was worth $800,000, then when you sell it for $800,000 you will have a taxable gain of $790,000 which will be considered long-term capital gain since they held it for more then one year. Long-term capital gains are subject to a maximum Federal tax rate of 15% ( to the extent the gain would otherwise be taxed in the 10% and 15% brackets it is taxed at 5%). If the gain is considered to be short-term (i.e. held less then one year) then the gain is treated as short-term capital gain (to the extent not offset by other capital losses) and is taxed as ordinary income subject to tax at your marginal tax rates. The donor will be required to report the gift on Form 709 by the due date of the income tax return. How were you able to be gifted property subject to debt?
Alternatively, if you inherit the property as a beneficiary of a will or living trust, then different tax consequences apply. An estate is required to file an estate tax return if the decedents assets are valued at $1,500,000 or more (before debt or mortgages). If the decedents estate owned the house, sold it and then distributed the cash to you, then you have no tax liability whatsoever (i.e. estate, inheritance or income). The estate will report the sale and bear any tax consequences.
If the estate transferred title to you BEFORE its sale, then while you will not owe an estate or inheritance tax, you may owe income tax. If you were on the title prior to sale, then the sale transaction of the property is reportable by you and any other heirs on the title in your proportionate share. Thus, the sale will need to be reported on schedule D of your Form 1040 for the year of sale.
Your cost basis in the property is equal to the value of the home reported in the decedents estate tax return (Form 706). If an estate tax return was not filed, then your cost basis is the fair market value as of the date of death of the decedent from whom you inherited the property (get an appraisal).
The reported sales price will be equal to your proportionate share of the proceeds fom the sale less selling expenses. The cost basis will be equal to your proportionate share of the date of death fair market value plus any improvements made after death but before the sale. Thus, when you inherit a property and later sell it, you will only be taxed on any post-death appreciation. Such gains are automatically considered to be long-term capital gains subject to a maximum tax rate of 15% (see above).
In either scenario you will also have to report the transaction to your state if your state has an income tax.
Thus, if you received the property by gift from a living donor, you succeed to their cost basis and holding period for tax purposes. If you inherit the property you get a step-up in th ecost basis to its fair market value and you are automatically presumed to have held the property for more then one year (i.e. you get to use capital gains rates which max out at 15%).