Your bad credit can affect you in many ways when buying a home.
Besides for possibly not qualifying because of a low score, many people with low credit pay more for their car loans and credit cards.
A larger percentage of your income will be taken up by these higher bill, leaving you less income to use to qualify for a mortgage.
For example, if you earn $3000 a month, you might qualify for a mortgage of $1500 per month (taxes and homeowners insurance inclusive). If you have $300 monthly minimums in credit cards and a $400 monthly car payment, you will only qualify for a payment $800.
People with good credit pay less for their other debts, allowing them to borrow more money, while people with bad credit pay more for their other debts so they can't borrow much.
Generally when someone has bad credit, even if their score is high enough, they may have collections and judgements as well on their credit report and most of these would have to get paid off before getting a loan.
If someone has bad credit there are ways to clean it up. They should take a credit counseling class offered by many organizations in most states.