You would have to check with an attorney or the City zoning ordinance on this. I think that you are allowed 2 persons per room. Then the question becomes what is a room? It might even be 2 per bedroom and another 1 or 2 in the dining room.
I have seen places where every room--the living and dining rooms--not the kitchen--was used as sleeping quarters.
With high rents in San Francisco, it is the only way people can afford to live!
Heck, I even saw an illegal unit recently with a family of 4 in one bedroom, another guy in a really small (probably not legal room) and another guy underneath the stairs in what should have been the laundry area!
That was the only way this family could afford their rent. Kind of sad in some ways.
As long as people aren't causing problems--as in an REO I sold once in Mission Terrace that had once had 9 separate leases and the electricity was a mess--and neighbors don't complain, there usually isn't a problem, (In this situation, the neighbors did complain as there wasn't any parking at this house and it was a small street so the neighbors couldn't park either!)
Hope this helps.
LEOPOLD A RODRIGUEZ
Real Estate Broker 00849905
Attorney at Law
400 Montgomery 505
San Francisco CA 94104