Dear Sir,
Hope you are doing well !!
Home loan and Capital Gains Exemption are two separate things. You can claim the Capital gain exemption only if you use the money from the sale of the property to buy another house. The purchase of new house has to be done one year before the sale of the house or 2 years after the sale of the house. The property should be bought in the name of the seller. Income tax department is not concerned if you used the sale money for repaying the home loan or not.
In your case, you can not take any capital gain exemption on old property purchase.
However,you can claim tax exemption by using the amount you gain from selling property to buy bonds issued by NHAI and REC.The bonds should be bought within 6 months of the sale of the asset. The maximum amount you can invest in this way is Rs. 50 lakh. It will lock your money for 5 years.
It is advisable to take a phone consultation for detailed discussion.