The short answer is that everyone who is an individual (meaning a human made of flesh and blood as opposed to some type of business entity) qualifies for some type of bankruptcy. There are 3 main types of bankruptcy.
A Chapter 7, if you qualify, may eliminate most, if not all, of your debts without you having to pay anything.  
You qualify for a Chapter 7 if your income is below a certain level, called the state median income. In California, this is $5,244.83 per month for a 1 person family, and $7,727.92 per month for a 3 person family.

If your income is over that level, you may still qualify for a Chapter 7 depending on your expenses.
If your debts are mainly business debts rather than consumer debts, then there is no income limit for a Chapter 7.
The next main type of bankruptcy is a Chapter 13, where you pay as much as you can afford to pay over a period of 3 to 5 years. You qualify for this if your debts are below certain limits, which are $1,257,850 for secured debts, such as mortgages on real estate, and $419,275 for unsecured debt, such as credit cards.
If your debts are too high to qualify for a Chapter 13, you can file a Chapter 11, which has no debt limits.  This type of bankruptcy is generally used for business reorganization, but can also be used by individuals.
Just because you are able to file a bankruptcy doesn’t mean that you should. There may be other consequences. For example, if you have assets that are worth more than you are allowed to keep, you might lose some of those assets.