Dear Tax Talk,
I am a single parent and in 2007 I bought a home to use as a rental. Although the loan papers said this would be an owner-occupied property, the mortgage lender I worked with said that wasn’t a problem and I don’t need to worry about it.

I recently agreed to a loan modification of the mortgage on the home in which my son and I live. Although the modification didn’t really lower my payments, it changed the negative-amortization mortgage I was in to a mortgage that will eventually pay down the principal.

My renter (at the home I purchased in 2007) is having difficulty making rent payments, but in order to rent to someone else, I will need to spend about $15,000 in repairs, etc., which I don’t have. If I were to let the rental foreclose, will I be responsible for capital gains or other types of taxes? When I bought the house in 2007, it appraised for $457,000 and I purchased it for about $420,000. Based on comps in the area, it is currently worth about $170,000 at the most. I feel very stuck, and am very afraid. I hope you can help.
— Janet

Dear Janet,
Even though you may be stuck with a foreclosed rental, at least you saved your home before your credit takes a hit. Apart from the impact on your credit, a foreclosure can be costly tax wise if you’re not prepared. For taxpayers realizing foreclosures on personal residences, the law was changed so that in most cases a taxpayer will not have to recognize and pay tax on forgiven debt. These rules don’t apply if the property is a rental foreclosure.

Assuming you owe the full $420,000 and the home is valued at $170,000 tax wise, you stand to gain $250,000 in the rental foreclosure. When you borrow money, you don’t realize income for tax purposes, based on the theory that you will have to repay it. When you don’t repay the debt and it is forgiven by the lender, you realize a gain for taxes. A lender will usually forgive the debt if there is no chance of collection. Part of the lender’s determination is based on your assets exempt and not exempt from their claims.

When it comes to taxes, the IRS doesn’t see it that way. Your exempt assets may end up causing you to pay tax on forgiven debt. A taxpayer who is not in bankruptcy can exclude gain on forgiven debt if he is insolvent. Insolvency means the extent to which your liabilities, including the forgiven debt, exceed your assets. However, unlike bankruptcy, the IRS is measuring insolvency by including exempt assets.

Assume your home and mortgage are worth the same and you have no other assets. If your rental goes into foreclosure, you may have a $250,000 gain, but the insolvency exception will allow you to avoid recognizing and paying tax on that gain. Now if you have retirement accounts or home equity which may be exempt from creditor claims, you could end up paying tax on the forgiven debt to the extent of the value of these otherwise exempt assets. Although the creditor won’t go after you, the IRS will. Your best solution to avoid the reach of the IRS would be to go into bankruptcy prior to the foreclosure.

To ensure compliance with requirements imposed by the IRS, we inform you that any U.S. federal tax advice contained in this communication (including any attachments) is not intended or written to be used, and cannot be used, for the purpose of (i) avoiding penalties under the Internal Revenue Code or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein. Taxpayers should seek professional advice based on their particular circumstances.

Read more Tax Talk columns. To ask a question on Tax Talk, go to the “Ask the Experts” page, and select “Taxes” as the topic.