The deduction of principal repayment shall be available u/s 80C and the interest shall be allowable u/s 24.
If the house against which loan has been taken is sold out, you will be able to claim the benefits of deduction.
Further, 99% properties are mortgaged against which loan is taken. So you will not be able to sell the house until and unless the loan is squared. Thus the question of claiming interest and principal repayment benefit does not arise.