Hello I am a licensed attorney here to help you with your question, please review my response and do not hesitate to ask for clarification.
If you do not have the money to pay the debts on the cancellation of debt, you would file for insolvency and then you would not be liable for any taxes.
You are insolvent if your liabilities (the total amount of all debts) were more than the fair market value (FMV) of all of your assests immediately before the discharge. For more details on what it means to be insolvent, please reference IRS Publication 908, Bankruptcy Tax Guide.
Example: During the tax year, you were released from your obligation to pay back a credit card debt in the amount of $5,000. At the time of the discharge, the FMV of all of your assets totaled $7,000 and your total liabilities totaled $10,000. Therefore, you were insolvent to the extent of $3,000 ($10,000 in liabilities minus $7,000 in FMV of assets). In other words, your liabilities were $3,000 greater than your assets, so that is the extent that you were insolvent.
Because you were only insolvent to the extent of $3,000, you could only exclude $3,000 of your cancelled debt from income. The remaining $2,000 would have to be included in income unless you meet one of the other exclusions.
The form can be found above