two family house

Can I get a capital gains exclusion? I have owned a 2-family house for 25 years. I have lived in one unit w/ my wife and rented the other. I have depreciated the rental unit.I am considering converting the house into two condos and moving into the rental unit and selling my current residence unit. I plan to stay there for at least 2.5 years and then consider selling it and moving. 1) When I convert the house to condos, do I have to recapture the depreciation then or can I delay that until I sell the rental unit I moved into?2) If I sell the rental unit I have lived in for 2.5 years, will I get a full $500,000 reduction on my capital gains or will I get a reduction that coincides with the percentage of time I used it as my primary residence in relationship to my entire ownership period. For example – owned for 27.5 years, rented for 25, primary residence 2.5 years – capital gains reduction 2.5/27.5 = 9% of the usual $500,000 exclusion?