Someone can be homeless if they are staying with friends or family because they have nowhere else to go, living in temporary or unsuitable accommodation, or facing the loss of their home.
Many people who are homeless, or at risk of it, are also dealing with other difficulties at the same time. Having a settled place to live can make it easier to deal with those other things.