It is legal for NRI's to invest in India. The Indian government has allowed 100% repatriation for NRIs. The Reserve Bank has granted a blanket permission to NRIs to purchase immovable property in India for their residential and commercial purposes. There is also no limit on the number of investments or the quantity of investments that can be made in real estate. However, the amount should not be more than the foreign exchange in to hold the property. The property can be purchased from any place outside India or through funds maintained in NRI accounts in the banks within the country.
There are some rules regarding the SALE of property purchased by an NRI. NRI is allowed to sell property only after three years from the date of acquisition for the property or from the date of payment of the final installment of the consideration for its acquisition, whichever is later.
For more details on the purchase or sell of property by NRI's it would be best if you seek legal professional help.