Generally speaking, depreciation is something that you use to write down the value of long-lasting assets that you acquire for business or investment purposes. For example, a business might depreciate its computers or its fleet of vehicles. Real estate investors depreciate buildings, whether they are large skyscrapers or single-family rental properties. Homeowners can even claim a depreciation write-off if they use a portion of their home as a rental property or if they have a designated home office.
Selling an Investment House
Most people know that when they sell a home that they own as an investment they must pay capital gains taxes on any profit that they earn over the original purchase price. They also must pay a 25 percent federal recapture tax on any depreciation that they claimed if the property sells for above the depreciated value. For example, if you bought a house for $300,000 and sold it for $500,000 after claiming $100,000 in depreciation, you would pay capital gains taxes on the $200,000 profit and recapture taxes on the $100,000 in depreciated value.
Exchanging an Investment House
One way to avoid paying capital gains and recapture taxes is to exchange your property. If you plan to buy more investment real estate with the proceeds from the sale, you can structure the whole transaction as a 1031 Tax-Deferred Exchange. In a 1031 Exchange, you carry your depreciated basis forward to your new property, saving you from having to pay any capital gains taxes or recapture tax at the time of sale.
Selling an Owner-Occupied Duplex
When you sell a duplex or other multi-unit property in which you occupy a unit as your own home, the IRS treats it as two sales. Your portion of the building gets treated as a personal residence and gets the benefit of the generous capital gain exclusion. The other part of the building gets treated as an investment property, meaning that you must pay both the 15 percent capital gains tax and the 25 percent depreciation recapture tax.
Selling a House with a Home Office
If you claimed the home office deduction, you will be responsible for paying depreciation recapture tax on the amount that you could have depreciated on your home office, whether or not you claimed the depreciation. While your house is still eligible for the standard capital gains exclusion of up to $500,000 that applies to most houses, you will have to pay the 25 percent recapture tax on the total amount of any depreciation you claim. This becomes due when you sell your house.
ref.link: http://homeguides.sfgate.com/happens-sell-house-depreciated-41474.html