Investment of capital gain of two properties in purchase of 50 % share of residential property

Sir The issue is whether exemption u/s 54 is applicable if one residential property is bought on sale of two properties ( Commercial & Residential ) and what precautions ( i.e drafting purchase deeds ) are to be taken at the time of registration I intend to sell residential property now and sold a commercial property one year ago as per following details {Commercial Property Sold in Sep 2017 @ Rs 65 Lacs ( Capital Gain Rs 40 Lacs ) } and {Residential Property intend to sell @ Rs 80 lacs ( Capital Gain Rs 60 Lacs ) } Intend to invest the entire proceeds of Rs 145 Lacs in a residential plot with registration value of Rs 300 Lacs in partnership with one of my friends. Further constructing it by investing another Rs 100 Lacs i. e Rs 400 lacs will be invested in the plot and construction. My 50% share will be Rs 200 lacs which will be from the entire sale proceeds of both properties ( Rs 145 lacs) and home loan of Rs 55 Lacs Finally my physical occupation/share will be two floors out of four after construction What is the legal status as an individual since the property being acquired is in two names ( friends ) under Reinvestment of Capital Gains as viewed under u/s 54 Income Tax