How can I claim relief in case of selling a residential property to buy another residential property?

How can I claim relief in case of selling a residential property to buy another residential property?

Under section 54, any long-term capital gain arising to an individual or an HUF on sale of a residential property shall be exempt if the capital gains are invested in another residential property. The property sold can be self-occupied or rented.