The Internal Revenue Service played Santa Claus last week and handed an estimated 6 million American homeowners an unexpected gift: an automatic exemption from a tax-time mortgage interest deduction nightmare scheduled for 1988.

Since you may be one of the 6 million lucky owners -- or one of the 500,000 to 900,000 who will get coal in their stockings instead -- here's what happened.

In August, the IRS unveiled what even its own officials conceded was a bureaucratic monstrosity: a tax form that would have to be filled out by every American homeowner who sought to take the standard mortgage-interest deduction. If you don't fill it out, the IRS said, you can't write off a cent.

The new Form 8598 came with four pages of instructions set in minuscule print, and required millions of taxpayers to fill out two pages of numbers. Among its notable features was a requirement that every homeowner choose one of five permitted mathematical methods for computing something known as the "average balance" of each of their mortgages on their principal and second residences during the year. The new form also took taxpayers through computations regarding the total dollar value of improvements made to their houses since they had bought them, the cost of medical and educational expenses during 1987, and finally the jackpot issue: Do you or do you not make the grade for full deductions this year? If not, how much of what you thought you could write off will Uncle Sam allow you? Accountants, lawyers and financial planners who saw the August Form 8598 were aghast. It was so complex, they agreed, that even a taxpayer with a relatively simple financial profile could get bogged down for hours. Hundreds of thousands of people would need professional assistance to complete it -- an ironic twist for a tax-simplification initiative.

IRS got the message. The revised version of the mortgage deduction Form 8598 will be mailed soon. Rather than forcing every homeowner to prove himself or herself worthy of a writeoff, the government now suggests the reverse: Don't worry about this form, the instructions say, unless you know that you need to. You don't need to as long as you're certain that "the total price paid for {your} home plus the cost of improvements {was} greater than the total of all mortgage debts at all times in 1987."

But who has to fill out Form 8598? You will, says IRS, if you: "Took out a mortgage on your home after Aug. 16, 1986, or you borrowed any additional amounts on a mortgage after Aug. 16, 1986, and, "At any time in 1987, the total of the principal balance of all your mortgages was more than the price you paid for the home plus the cost of improvements."

Note the word "and" between the two criteria. Simply because you refinanced your house this year, or bought a new home, doesn't mean you have to file Form 8598. You're automatically exempt as long as you're certain that your mortgage balance was less than the cost of your house (and subsequent capital improvements) throughout 1987.

IRS offers an illustration of someone who will have to file. Say you took out a second mortgage last July for $25,000. You also had a first mortgage of $65,000. The cost of your home plus amounts you've spent on improvements came to $80,000 by the end of 1987. Since the combined total of your two mortgages ($65,000 plus $25,000 equals $90,000) exceeds your purchase price plus improvements ($80,000), you must fill out and file Form 8598.

If you're one of the 500,000 to 900,000 owners IRS believes will have to plow through the form, consider this: Like its August forebear, it has four pages of fine-print instructions. Unlike that earlier form, IRS has sought to make it a little more user friendly.

For instance, rather than forcing you to use one of five barely comprehensible computations for your average mortgage balances, IRS now allows you to "use any reasonable method."

The agency also attempts to answer common questions in the instructions, such as: What are bona fide home improvements in Uncle Sam's eyes? Here's the official answer. Home improvements are "items that add to the value of your home, prolong its useful life, or adapt it to new uses. Do not include the value of your own labor in determining the cost of improvements. Repairs that maintain your home in good condition, such as repainting, are not home improvements."

For guidance, get the IRS's free new guide, "Publication 932, New Rules for Home Mortgage Deductions," which should be available next week at local IRS offices or by calling 1-800-424-FORM.