Can you buy a house with a bad credit score?
Bad is a relative term but scores below 600 can limit your options. Some mortgage companies can go down to a 580 credit score (or even a little lower) but they will have more restrictions as well.
The key is to plan ahead of time. If you are 6 months out from planning to buy a home and have less than perfect credit, think about credit repair. Just improving your score a little bit can open up more options and save you money in the long term.