There are two components to see if you qualify for chapter 7. The first is a calculation of your "Current Monthly Income" based upon your previous six months of income. The court looks at income from all sources other than social security over the six months ending prior to the month your case is filed, and if you're below the median income for your state and household size, you can file chapter 7. See the chart below.
If you're above the median income for your state and household size, you may still be able to file chapter 7, but you have to go through a long calculation called the "Means Test" to determine what your disposable income is. If that calculation says your "disposable income" as determined by the bankruptcy code formula is negligible, you may still file a chapter 7. If it determines that you have disposable income, you must pay all of your disposable income to your unsecured creditors for five years. The means test calculation is too complicated to summarize in a blog post. Most bankruptcy attorneys use software to do the actual calculation. If you want to know if the Means Test will allow you to file a chapter 7, talk to an experienced bankruptcy lawyer.
Median Income for cases filed between 5/1/17 and 10/31/17 by state and household size: