When reporting the sale of or computing gain or loss on rental property, you are required to make an adjustment to your basis for allowable depreciation regardless of whether the deduction was taken. For more information refer to Publication 544, Sales or Other Dispositions of Assets, and the Form 4797 Instructions, Sales of Business Property.
You can claim the depreciation not taken for the rental property in the years before the year of sale. How to do this depends on when you placed in service the rental property. If you placed the rental property into service in the year immediately preceding the year of sale, you may amend your income tax return for that prior year by using Form 1040X (PDF), Amended U.S. Individual Income Tax Return, to take the depreciation deduction for the rental property that should have been taken. Or, you may file a Form 3115 (PDF), Application for Change in Accounting Method, to claim the depreciation for the rental property that should have been taken for the prior year. The Form 3115 must be timely filed for the same tax year in which you sell the rental property.
If you placed the rental in service more than a year preceding the year of sale and if you took no depreciation deduction, or a deduction of less than the allowable amount for two or more consecutive years , you must use Form 3115 (PDF), Application for Change in Accounting Method, to claim the depreciation for the rental property that should have been taken for the years before the year of the sale. The Form 3115 must be timely filed for the same tax year in which you sell the rental property.
References:
Publication 544, Sales or Other Dispositions of Assets Form 1040X (PDF), Amended U.S. Individual Income Tax Return Form 3115 (PDF), Application for Change in Accounting Method Form 3115 Instructions, Application for Accounting Method Form 4797 Instructions, Sales of Business Property Publication 527, Residential Rental Property (including Vacation Homes) Source: www.irs.gov