"The house passed H.R. 3648 to amend the Internal Revenue Code of 1986 to exclude discharges of indebtedness on principal residences from gross indcome, by a recorded vote of 386 ayes to 27 nays."
This is the "The Mortgage Forgiveness Debt Relief Act of 2007".
If a lender "forgave" you for a debt, you would have to pay tax as the IRS treated that forgiveness as taxable income. So, if you owe the bank $10,000 and the bank never collected that money and forgave the debt, they would send you a "1099" with the amount of $10,000 and you would have to include that amount on your tax return.
Let's take a step further. You own a house that has a mortgage of $200,000. Let's say, you want to sell it because you can't afford the mortgage payments and you are behind. You find out the house is only worth $180,000 and proceed with trying to sell it. A buyer comes along and will pay full asking price of $180,000 leaving you still owing the lender $20,000. Since you don't have $20,000 to pay, you have to get the lender's permission to sell the house at the lower amount, forgiving you the $20,000 you owe.
So, in the past, you would pay tax on the $20,000 you never paid - the IRS treated it as income. Now, with the "The Mortgage Forgiveness Debt Relief Act of 2007", if the lender forgives you for the $20,000, you won't have to pay tax on it.
There is more to the tax liability on profit regarding homes. You will need to contact a Tax attorney or CPA as each individual is different based on their income, actual profit made etc.