When an immovable property (Land or building) is sold, resulting in capital gains, one needs to pay long-term capital gains (LTCG) tax. There is an option under Section 54EC which can be used to avail tax exemption by buying Capital gain bonds or 54EC bonds. These bonds are issued by infrastructure companies that are backed by the government. Hence, the risk factor is low in these bonds.

Capital gain is calculated after indexation of the cost of acquisition.
Example - Property purchased for ₹30 lakhs in 2015 and sold for ₹70 lakhs in 2020. Assuming indexed cost of acquisition (indexation figures are released periodically) is ₹40 lakhs. The investment to be made in bonds is on the capital gains post indexation (i.e. ₹70 lakhs - ₹40 lakhs = ₹30 lakhs). Once the investment is made within 6 months, capital gains tax need not be paid for the extent of investment (upto ₹50 lakhs).

Bonds eligible for exemption under this section:

Rural Electrification Corporation Limited or REC bonds,
National Highway Authority of India or NHAI bonds,
Power Finance Corporation Limited or PFC bonds,
Indian Railway Finance Corporation Limited or IRFC bonds

Details on these bonds:

Bonds need to be purchased within 6 months of the date of sale of immovable property to avail tax exemption
These bonds have lock-in period of 5 years and are non-transferable
Maximum tax exemption allowed is ₹50 lakhs
Interest earned from these bonds are taxable