Without wanting to sound unsympathetic, what relevance does your history of homelessness actually have to your question? To qualify my point: Ideally, you won't be explaining your personal history to a prospective employer in these terms. It's unfortunately all too common for people to fall on hard times resulting in prolonged periods of unemployment. Breaking ( back ) into a career after these gaps is an extremely hard task for an individual. Most people I've known ( myself included ) were able to do it though, through either good luck or perseverance ( or some mix thereof ).
Don't expect to be given a chance on the basis of sympathy. I'm sorry that this might sound a bit unfriendly, but it's the unfortunate truth. You'll need to accept the fact that your personal history will be a setback, to one extent or another.

Just so you don't think I'm overly unsympathetic, here is my personal story: I had a very rough upbringing. I moved between an unstable and violent household and the streets throughout my teens. I had very little positive influence throughout my childhood. I dropped out of school at 16 years old and lived as a petty criminal until my mid twenties. I did work some minor entry-level jobs from time to time, but certainly nothing that I would even want to list on a resume. Mostly manual labor.
I spent some minor time incarcerated as a result of being convicted of many minor crimes. I feel very fortunate that I do not live in the US, where a history of incarceration permanent blacklists you from most professions. During an altercation I was injured very badly. I suffered ligament and tendon damage in my leg which near crippled me. It took two years of physiotherapy before I was able to even run at a jogging pace. I wasn't going to be very good at my present vocation if I could only limp around the place. This necessitated major changes in my life.
I was very depressed and purposeless for some time, but after a bit of an epiphany I won't bore you with I decided to seek gainful employment.

I was about 26 years old at this point. I had some minor experience with programming from having an interest in graphic design as a kid. I took a terrible entry-level job in technical support and taught myself some web development while there. I was basically exploited by this company but I gained a sense of pride in being a reliable and competent worker. I had expected to be spat on by the rest of society, but I found that I was a smarter and more reliable worker than my peers and was quickly promoted. By complete chance I overheard a different department interviewing applicants for a web design/development role within the company. In a pivotal moment that would change my life I decided to just knock on the hiring manager's door and tell him that I had these skills. They submitted me to the same test they gave the applicants, which I ended up acing. From that day on I moved into my first programming role. The rest is history. I've been in this field for years now at a variety of companies. I have had to explain my past a few times, never publicly. Fortunately it's been 8 years since I last had any trouble with the law, so most companies have been able to overlook this.

It is certainly possible to break into the industry with minimal experience and a terrible past. You can always start in very junior positions just to get your foot in the door and improve your resume. From there you can bend the truth without pushing the envelope. Work your actual skills into your work history creatively, pursue every chance you get to prove yourself to your employer. Jump at every chance you get to excel!
There's no need to be brutally honest about your history either. Don't expect anyone to take pity on you, they won't.

Best of luck, and merry Christmas!