Homeless in Germany are much more rare than in the USA due to the simple fact that we have a government-guaranteed unemployment payment program called Hartz 4.
If you're unemployed for a very long time, you are entitled to these things (if you're unemployed in the short term, you're actually entitled to more than the listed):
* the state will pay your rent, water, heating, trash retrieval, etc. (maximum level of that depends on where in Germany you live)
* the state will pay your insurances for rent, illnesses, accidents and extended medical care
* the state will pay you 374€ per month, which you can use for power, internet, food, etc.
A small note: The mentioned insurances are mandatory in Germany and will be removed along with the tax from your job earnings (as an employee) before the cash is even put into your bank account.
So, to become homeless you need to either choose it willingly, or be in such a mental state that you somehow manage to slip through the social security net, but aren't functioning badly enough that the state hasn't picked you up yet.