Q: My husband and I previously owned two houses. We separated for a few years and he lived in one home and I lived in the other. Two years ago we reconciled and purchased a third house, which is now our primary residence. We want to sell the other two houses now. Do we have to pay capital gain on these houses?

A: You have a tricky question here. The general rule is that you can exclude from federal income taxes up to $250,000 of profits from the sale of your primary residence if you have lived in that residence for two out of the last five years. If you are married, you can exclude $500,000 of profit from the sale of your primary residence from federal income taxes.

Since you have not lived in either home for the last two years, the time is running out to satisfy the two of out the last five year requirement. If you fail to sell and close on the sale of the home by the time you celebrate your third anniversary of having not lived in the homes, you will no longer qualify for the basic requirement that would allow you to exclude any gain from the sale of the residences from federal income taxes.

While there are some exceptions to this rule, it does not appear from your question that you would be entitled to any of those exceptions: change of employment, health reasons or other unforeseen circumstances.

You stated that you both have been married but at times have lived separately. The first thing for both of you to determine is whether you will have a profit on the sale of your homes. If based on current real estate market conditions you will not have a profit, you shouldn’t have to pay taxes on the sale of the homes. If you’ve rented the homes and you’ve taken tax benefits from the home due to their becoming investments for you, you may have taxes to pay.

Assuming that both of you have been filing your own tax returns, if each of you lived in your homes for two out of the last five years and each of you maintained your primary residence in your respective homes, you should be able to exclude from any federal income taxes up to $250,000 of gains. That’s to say, if you each made a profit on the sale of the homes, each of you could keep up to $250,000 of the profits without paying any taxes to the federal government.

But each of you will have to file your own returns for the year in which the home was sold. If the profit on the sale of either home is more than $250,000, the profit in excess of that amount will be taxed to you at your capital gains rate of up to 20 percent.

Finally, if either one of you rented the homes and took depreciation on the homes, you’ll have to pay back that benefit when you file your income tax return. When you have an investment property, the federal government allows you to take certain tax benefits from the ownership of an investment property. But those benefits must be repaid to the government when the property is sold.

If you have an idea of what the properties will be sold for, you should try to take a stab at figuring out whether either of you will have a profit from the sale of either of the homes.

Take the purchase price for each home, then add to that number the costs you incurred in purchasing that home (including loan costs and title insurance fees), include all capital expenses you incurred while you owned the home (new roof, boiler, new windows, etc.), and then add to that all of the anticipated costs to sell the home such as commissions and fees. Once you have that number, you can compare it to the price you expect to get for the sale of the home and you’ll have a rough idea as to whether you have a profit on the sale or not.

If you bought the home for $100,000 and had purchase costs of $5,000, then put in two new bathrooms and new kitchen appliances and cabinets at a cost of $30,000; and when it came time to sell the home for your anticipated selling price of $150,000, you expect a real estate commission on the sale of $9,000 along with other closing costs of about $6,000, you’ll expect no profit on the sale of the home. All of the costs and expenses will have eaten up any profit on the sale of the home.

Talk to your accountant further to go over all of the costs and expenses from the purchase of each home and the costs and expenses on the sale of each home to see if you might end up with a profit or not and whether you would qualify for the $250,000 exclusion on the sale of each of the residences and to go over any of the particular issues that may affect your specific circumstances. For more details, check out IRS Publication 523, Selling Your Home.