WASHINGTON — Although it wasn't a total win for homeowners and sellers, the patchwork legislation that emerged from the "fiscal cliff" fracas on Capitol Hill came pretty close. It even reached back and resuscitated two key tax benefits for housing that had expired more than a year ago. Now homeowners will be able to take deductions on their upcoming 2012 tax returns that they assumed were no longer available.

Here's a tally on what the new legislation could mean for you.

• Do you pay mortgage insurance premiums or guarantee fees on an FHA, VA, Fannie Mae, Freddie Mac or Rural Housing loan? The American Taxpayer Relief Act — the fiscal cliff compromise bill — allows you to write off the insurance premiums you paid during 2012 along with your mortgage interest, provided your household income does not exceed $110,000. Legal authorization for this deduction expired at the end of 2011. But the new bill retroactively permits write-offs for all of 2012 and 2013 for qualified borrowers.

• Did you do some energy efficiency renovations in your home in 2012, installing insulation, energy-saving windows, doors, roofing material, non-solar water heaters and the like? Maybe you're thinking about doing a little green rehab in 2013? For either year, you may be able to claim up to a $500 tax credit thanks to the revival of a home energy improvement incentive that lapsed in 2011. Five hundred bucks may not sound huge, but remember: It's a credit, not a deduction, so it means $500 off the bottom line of your federal tax return.

• Are you planning a short sale of your underwater home this year or hoping to receive a principal reduction on your loan as a result of a mortgage modification by your lender? The new legislation reauthorized the Mortgage Forgiveness Debt Relief Act that had been scheduled to terminate Dec. 31, and spares you potentially punitive federal taxes on the amount forgiven. Had the debt relief exception in the tax code not been renewed, large numbers of underwater owners participating in short sales — where banks agree to accept less than the full amounts owed on a loan as part of a sale to a new buyer or investor — would have faced taxation on the full amount forgiven, as if it were regular income. Lenders and real estate brokers say thousands of financially distressed homeowners would have been devastated by the expiration.

What's in the legislation that some buyers or sellers might not like? Start with steeper capital gains taxes for high-income sellers with big gains that exceed current federal exclusion limits of $250,000 (single tax filers) and $500,000 (married joint filers). Say you are a single earner and earn more than $400,000, or you're married, file jointly and earn more than $450,000. Under the new legislation, you can expect to pay 20 percent on capital gains. So if you sell your principal residence this year and your gain on the sale is $750,000, the capital gains tax on the $250,000 excess above the $500,000 exclusion limit will be at 20 percent, rather than 15 percent. Sellers with income below the $400,000 threshold will still pay capital gains taxes at 15 percent, and earners at the two lowest tax brackets will pay zero on capital gains.

The fiscal cliff deal also limits deductions for mortgage interest, property taxes, charitable donations and other write-offs for single-filing taxpayers with adjusted gross incomes above $250,000 and married joint-filers above $300,000. The formula it uses is complex, but it could amount to about $1,000 in additional tax liability for a couple with an income around $400,000, according to housing industry estimates.