Hey @amitava82,
Exemption under sections 54 and 54F is available on long-term capital gains when you purchase or construct a new house property. Even if you take a home loan to purchase the new property, you can claim the exemption, however, the maximum exemption allowed will be the amount of capital gains.
Moreover, you must purchase a new house property before 1 year or after 2 years from the sale of the long-term asset. In the case of construction of a new house property, the construction must be completed within 3 years. Hence, it cannot be claimed retrospectively if the purchase was made before one year from the sale of the long-term asset.
You can read more to understand the eligibility criteria for claiming an exemption under sections 54 and 54F.