Hawzah News Agency – Q: I have an outstanding debt on the house and I will remain indebted for 12 years, please enlighten me in regard to my liability to khums, i.e. is this debt to be subtracted from the gain of the year?
A: you are allowed to pay the installments of a loan which was spent last year for constructing a house and similar things from your gains during the year. But, if not paid, they are not subtracted from the year’s gains. The gains remained at the end of the khums year are subject to khums.
Source: https://www.leader.ir/en/book/32/Practical-Laws-of-Islam