It does not appear as if either you or your ex-husband will have to be concerned with capital gain.
The principal balance of your loan (mortgage) has nothing to do with gain or loss. If you subtract your basis (the purchase of $168,000), plus any improvements you might have made, from your selling price of $170,000 less selling expenses, it appears you will have a loss (which you cannot recognize since the loss is derived from personal use property).