When renting out a room, is depreciation still subject to recapture? What about capital gains?

We converted our basement to an in-law suite and are renting it out to a tenant. The utilities are shared; it is not a duplex or legally separate unit. It appears (from pub 527) that we are able to claim depreciation on the building value of that portion of the house, as well as the money we spent converting the basement. Consequently, I understand (from pub 523) that we may need to pay back "some or all of [this] depreciation" at such time as we sell the house in the future.

 

Pub 523 states that "if the space you used for business or rental purposes was within the living area of the home, then your usage doesn't affect your gain or loss calculations." This would suggest that we would not be subject to capital gains tax on the first $500K of capital gains, despite the business use (renting).

 

Does a similar exemption apply to depreciation recapture? I don't want to be stuck with a huge tax bill if we move house in a few years' time.