5 legal aspects to consider before investing in real estate