Here is such kind of space that could be illegal to live in.
Basement: a basement cannot be used for a residential purpose in India. It’s illegal to use or put it for a rent. As per building by-laws, a basement can be used for parking or storage. A basement is not part of permissible FAR and also it is not safe to stay in the basement due to lack of ventilation and during an emergency it might become difficult to get out of the basement.
A terrace room: it's a common practice here that often people build a small room on their terrace along with bathroom and kitchen which is commonly called barsati. And they rent the space to earn some extra money. These spaces are popular among students or bachelors as they are affordable and also offer privacy in terms of being on the top floor. But these rooms might be illegal and unsafe as well. If the authorities get the information they might demolish the construction and you might get into a huge trouble. Hence to clarify this, you can ask for legal property papers or get rent agreement made to avoid any disturbance further.
Illegal floor: those who have individual houses often goes beyond the permissible limits or FAR and build some extra floors which become an illegal floor. In case you live on such floor then you might get into trouble. Hence before you take an accommodation for rent, do a bit of research about the property, know the FAR of the area. This will help you to know the permissible limits of building floors in that area and whether you will be staying in a legal or illegal floor.
Therefore, avoid taking these property types on a rental basis for residential purpose and for other spaces also do a thorough research to avoid further hassles.