Hi @AJC20178 seeing NPCs out in the world doesn't have any relation to whether they live in a house AFAIK.
If you are worried about them being culled from the game, you can click the heart in the Household Manager to add them to My Households and that should preserve them.
There are mechanics that make it more likely for certain sims to show up in certain places. For example, if they have the Active trait or a Like for fitness, they are more likely to show up at the gym. Occults of all kinds are more likely at the Moonwood Mill bar. Dog owners tend to walk their dogs in certain Brindleton Bay neighborhoods. There's some kind of hidden "barfly" trait that affects whether they show up at bars, not sure how that one works. Etc.
You can manipulate this kind of thing directly if you have Get Together, by making clubs that hang out at particular lots.