Finland is capitalist and kind of solved homelessness, with there being around only 1.3k homeless people in the entire country (population: 5.6m, which means the rate of homelessness is around 0.02%).
I don't think that communism or any ideology is an answer to homelessness, it's pretty much the job for the government and what kind of systems/reforms they implement.
You should instead read "Riding the wave" which is a serious book that explains why social democracies rely on imperialism using one case study (Denmark I believe but I haven't read it in forever)