Depends on the municipality. For a few years I lived in an old bread delivery van. Mind you, it was pretty nicely outfitted, albeit in very hippy gypsy style (complete with live plants*). A certain city in mid-Peninsula, California that shall go unnamed (but whose name loosely translates as Big Stick) kept a list of all the cars people were know to sleep/live in. I maintained a private postal box (Suite), but that didn't fly for the registrar of voters, so my official address was "downtown."
Was I homeless? So far in my life, that's the only time I actually owned my home.
*Which gave rise to the following little ditty:
I don't care which religion you practice,
'Long as I have my psychoactive cactus
Growing on the dashboard of my van.
etc., etc.