The answer to that question is; it depends.

What is on your credit? How long ago? What is your credit score?
I’ll answer those questions but first let’s look at how long certain events will prevent you from buying a home:

Chapter 7 Bankruptcy: You can buy a home after 2 years from the discharge date of a chapter 7 bankruptcy. There are a few exceptions that will allow you to buy after 1 year but only for “extenuating circumstances”.

Chapter 13 Bankruptcy: You can buy a home while you are still in the chapter 13 bankruptcy. You must have filed at least 1 year ago and you must have made all payments on time.

Short Sale. You can buy a home 3 years after a short sale. Veterans can buy after only 2 years. There are cases where that time frame is down to 2 years but you would need at minimum 10% down payment.

Foreclosure. You can buy a home 3 years after a foreclosure. Lenders will use the date the title actually transferred from the homeowner. Exception down to 1 year are possible for “extenuating circumstances”.

Judgments. Judgments will need to be paid or payment arrangements have been made with a history of on-time payments.

Collections. In most cases, collection over $1,000 will need to be paid or arrangements made to make payments. It’s also possible smaller collection account will need to be paid depending on how many there are.

Credit Scores: You can buy a home with lower credit scores but expect to pay a high interest rate and have a large down payment. Once scores increase, if a home buyer grant is available it’s possible to buy a home with little or no money down.