itemized deductions

The thing with a home office (in part) is that it has to be exculsivly used for such a purpose. As soon as any personal use is involved one is no longer entitled to the deduction.

In terms of taking it into account when selling your home, depreciation allowed or allowable has to recaptured as ordinary income. Notice I said "or allowable" because even if you didn't take the deduction you'll have to take it into account if you could have taken the deduction.