How to know if a secondary suite or basement apartment is legal—and a worthwhile investment