The planning code generally doesn't like to have rental unnits removed from the inventory so it will be hard to get permits for that. If the 2nd unit was put in without permit is will be easier to change back.
Your best bet is to go to the DBI and ask some questions. You could also start with a look at the tax records to see if it is a legal two unit building.
Planning Dept: http://www.sfgov.org/site/planning_index.asp
Dept of Building Inspection: http://www.sfdbi.org/
Whether this was done legally and properly, or whether you could bring the home into compliance, are different questions. You could go down to the Department of Building Inspection and pull the permit history to find out. You could also order a 3R report from them. This costs $160.
If you're considering buying a home like this, you should also consider working with a Realtor who can guide you through the associated issues.
Good luck to you!
McGuire Real Estate
Not sure what your asking. Was the home a Two Unit Building that was converted to Single Family Home or is it a Single Family Home on an RH-2 zoned property?
There can be with the former if it was not done with permit, but the latter is a typical scenario.
Mike Ackerman, CRS, e-Pro
Zephyr Real Estate
Web Reference: http://www.ZephyrSF.com