Section 17(5)(d) of CGST Act 2017, Credit is not allowed on goods or services or both received by a taxable person for construction of an
immovable property (other than plant or machinery) on his own account including when such goods or services or both are used in the course or furtherance of business.
Explanation.––For the purposes of clauses (c) and (d), the expression “construction” includes re-construction, renovation, additions or alterations or repairs, to the extent of capitalisation, to the said immovable property;
As per above section, credit is not allowed when the building is capitalised.
In this case you have to capitalise the building because you are going to give it on rental basis.