depends on city
in my county, owner has to live in upstairs to rent out basement. In another county, this is not enforced. In a neighbour city of a third county, this is not allowed to rent out basement. However, I saw the city made a modification in code last week that if the landlord pay an upfront fee of $2750, the city will issue a permit for basement rent if owner living upstairs.