Q: I have some questions regarding the tax exclusion homeowners are entitled to when they sell their primary residence. Let’s say a homeowner who has lived in his primary residence for at least two of the past five years is selling his home.

As I understand it, he is allowed to keep up to $250,000 tax free of the profits. But let’s say that six months to a year prior to the home sale, the homeowner marries and files jointly. Although one of the individuals hasn’t lived in the home for the full two years, would they still be allowed to take up to $500,000 tax free?

Also, let’s say there is some profit above the $500,000 or $250,000 (if the spouse is ineligible). Will the amount be taxed at the marginal tax bracket of the individual or couple or is it a flat 3 percent or 4 percent on the amount?

A: According to IRS Publication 523, selling your home, you and your spouse would qualify for the $500,000 exclusion if all of the following is true: you are married and file a joint return for the year in which you sell the home; either you or your spouse meets the ownership test, in which you or your spouse owned the property and lived in it as a primary residence for at least two of the past five years; and, during the 2-year period ending on the date of the sale, neither you nor your spouse excluded gain from the sale of another home.

If the owner of the property has only owned the property for 18 months before selling, he can take a proportionate share of the profits as an exclusion on his federal (and typically state) income tax return.

So, if you lived there for 18 months (1.5 years), you’d multiply your profits x .75 (or 75 percent of the 2 years required to take the full $250,000 tax free). If you’re married, you’d use $500,000 instead of $250,000.

To answer your second question, for profits in excess of what you can legally exclude, you’ll pay long-term capital gains tax, up to 20 percent, depending on your income level.

That is dictated by how much you and your spouse (if you have one) earn. For more details, check out IRS Publication 523, Selling Your Home.