The Mortgage Forgiveness Debt Relief Act of 2007 provided special relief to homeowners whose qualified mortgage debt was forgiven by lenders. Under the Act, the forgiven debt could be excluded from taxable federal income.
To qualify, the debt must have been on your primary residence (not a second home, investment, or rental property) and forgiveness must have been granted between January 1, 2007 and December 31, 2020, both dates inclusive.
In addition, the mortgage must have been used to purchase, build, or substantially improve your home.
Refinanced mortgages qualified, but only up to the amount of the original mortgage principal before the refinance. Refinance proceeds that were used to buy a car, pay off credit cards, or other purposes didn't qualify for relief (that is, they counted as taxable income).
The maximum amount of debt forgiveness that could have been excluded from taxation is $2 million ($1 million for married couples filing separately).
Not all states followed this law, which meant that some taxpayers still had to pay state tax on forgiven mortgage debt.