Living in a garage in California is only legal if the garage has been converted into a habitable space through the proper channels. Letting guests sleep in an unconverted space for a night can be a big enough violation to result in fines.