Many taxpayers believe that any interest paid on their home mortgage loan is deductible. Sadly, they're wrong. With home prices skyrocketing in many states, now's a good time to revisit the interest deduction rules for home mortgages and home equity rules.

Under IRS definitions, qualified residence interest is interest incurred from buying, building, or improving a taxpayer's qualified residence, or from home equity loans on that residence. The IRS generally doesn't count any of this as nondeductible personal interest. Taxpayers can deduct interest from up to two qualified residences: their primary home and one other vacation home or similar property.

However, this deal comes with strings attached. You can't deduct the interest for acquisition debt greater than $1 million ($500,000 for married individuals filing separately). For home equity debt, the limit is $100,000, or half that for married taxpayers filing separately.

Did you just close on your $2 million dream house? The one on the hill overlooking the lake? The one with the $1.5 million mortgage, for which you're planning to deduct the interest in full? Not gonna happen. Only the interest that you pay on the first $1 million in debt will be deductible. The rest will be considered personal interest.

Well ... maybe Uncle Sam will cut you one more break. You could define another $100,000 of that loan as home equity debt. But that'd still leave you with nondeductible interest payments on $400,000 of your loan. At a 6% interest rate, that's $24,000 in annual interest to pay taxes on.

Wait -- it gets trickier. That $1 million ceiling on deductible home mortgage debt includes both your primary residence and your second home. Too many taxpayers assume that they can deduct $1 million from each mortgage. But if you have a $700,000 mortgage on your primary home and a $500,000 mortgage on your cabin by the lake, you'll have to count $200,000 of the total as nondeductible personal interest.

Home equity loans are another thorny area. Consider the taxpayer who's got oodles of equity in her home. She's probably already using a home equity line of credit for various purposes -- but if she tries to deduct the interest from more than $100,000 of this debt, the IRS may not approve. Any home equity debt over $100,000 may or may not be deductible, depending on how the funds are used.

Suppose you already have $100,000 in home equity debt on your home. If you pull out another $70,000 to put down on a rental property, that interest will be deductible -- as rental interest expense, not home mortgage equity interest. But if you pull out that same $70,000 to buy that cute little Mercedes Benz you've had your eye on, no deduction for you.

The news gets worse. To assure the IRS that you're properly allocating your home equity interest in the proper classifications, you must follow the "interest tracing rules." The IRS usually categorizes interest depending on how a taxpayer uses the loan or debt proceeds, regardless of what got used as collateral. For example, interest on a loan used to pay for a personal vacation isn't considered deductible, even if the loan is secured by investment property or property used in the taxpayer's trade or business.

The interest tracing rules are complicated. Very complicated. But in effect, in order to deduct interest on more than $100,000 of a home equity loan, you have to prove that the funds you borrowed can be directly tied to how you used them. That means keeping the borrowed funds separate from the rest of your money. If you commingle borrowed funds in your personal account, or even between multiple personal accounts, they tend to lose their identity, and you could lose your interest deduction.

While we're at it, remember that you can't deduct interest on any portion of home loan debt above the home's fair market value. Recently, some lenders have extended loans greater than 100 percent of the home's value; the interest on the excess portion of that debt is not deductible.

So be very careful when you're buying your multimillion-dollar residence or vacation home, or cashing in on some of that tempting home equity. If you try to deduct too much, you might just get a housewarming visit from the IRS -- and they probably won't be bringing a welcome basket.

When he's not dealing with tax issues, Fool contributor Roy Lewis is a motivational speaker who lives in a trailer down by the river. He understands that The Motley Fool is all about investors writing for investors. You can take a look at the stocks he owns as long as you promise not to ask him which stock to buy. He'll be glad to help you compute your gain or loss when you finally sell a stock, though.