Why do you think the two are mutually exclusive? You can easily have rented a room or a couch in an occupied apartment through craigslist, airbnb, etc. That's legal here in NYC and likely where you are.
What isn't legal (here in NYC and many other places) is having someone rent out a completely unlicensed, unregulated, uninspected room as a 'hotel', which is what airbnb is mostly for.
Funnily, airbnb's silly new commercials here in NYC only touch on the folks who rent out a room in their apartment. They don't mention the illegal full-apartment rentals that are the majority of their business at all.