Home loan repayment through sale of house property

Shrenikk (Banker) (23 Points)

09 May 2017  
I will be buying a new house for which I would be taking home loan. This is a ready to move in house (a flat in a multi storeyed building). The existing flat where i stay is around 20 years old now. After shifting to the new house, I plan to sell my existing house (where i stay at present). Can the capital gain which will arise after selling my present flat (where i stay now) be used to repay the home loan which i will be taking for my new house, and therein getting exemption for capital gain tax. If yes, under what provision of the IT act.