Depreciation recapture is required when you dispose of what is termed Sec. 1245 and Section 1250 property. Section 1250 property consists mostly of real property (i.e. land and building structure including integral components of the building such as roof, windows, etc. that are replaced). Section 1245 property is most other tangible property included in the sale of the real property (i.e. equipment such as washers & dryers, refrigerators, etc.) if any.
For both Section 1245 & Section 1250 property depreciation recapture is limited to the lesser of your gain or depreciation allowed or allowable. All depreciation (including Sec. 179 expensing) taken on Section1245 property must be recaptured as ordinary income.
With respect to Section1250 property you only need to recapture the depreciation taken that is in excess of straight-line depreciation calculated using the same useful life. Accordingly, Section1250 property that is fully depreciated over its original estimated useful life at the time of sale will not have Section 1250 depreciation recapture (assuming the IRS does not challenge the useful life assumption in an audit).
For example, assume you have a property costing $250,000 with $150,000 allocated to the building which was depreciated by $100,000 up to its date of sale for $400,000. Accordingly, the preliminary gain is $250,000 (i.e. $400,000 less $150,000 basis ($250k-$100K depr.)). If under the straight-line method (i.e. allocated cost divided by the estimated months of useful life times months depreciated) the taxpayer would have only depreciated $70,000, then $30,000 of the of the $250,000 gain realized must be recaptured as ordinary income.
You report your transaction using form 4797 (http://www.irs.gov/pub/irs-pdf/f4797.pdf). Part III is where you will calculate the amount of realized gain and the recaptured depreciation if any. On line 25a you will enter al the depreciation taken over the years on the Sec. 1245 property including any Sec. 179 expensing you claimed. On line 26a you will report the amount of depreciation in excess of straight-line (if any) you claimed on the property over your holding period. For line 26b your applicable percentage will likely be 100% unless your property was government assisted or insurred housing, low-income housing, rehabilitation property or Title V loan property. You will have no amounts to enter on line 26d or f, 27, 28 or 29 since they do not apply in your situation. The rest is calculating the numbers on the form.