From what you have given me, I believe the bank will send each of you a Form 1099-G. The question is a complicated one. You need to contact a CPA for help on this one. H & R Block cannot help you, nor can a dimestore computer program like Quicken solve the mess you're going to be facing. Most lawyers including me have a hard time with this issue. This involves cancelled debt which gets reported as ordinary income on the line on your tax return for "Other Income". Watch out. You and your ex-wife could get crushed without professional help here.
… I agree wit the previous answer. Also, you might want to review the actual judgment entered in the foreclosure to se is you have personal liability. Good Luck.
Definitely check the court records, specifically the confirmation of sale, to see if a personal deficiency was entered against you. My opinion is, and others attorneys who have looked into this issue more might disagree (and I welcome input here), but I don't believe that the deficiency after a foreclosure sale is "forgiven" for 1099 purposes. For example, if you entered into a consent foreclosure or deed in lieu of foreclosure where the debt is explicitly forgiven, then you will receive a 1099 and may have to report the canceled debt to the IRS (there is an exception if the property is considered your “main home” for tax purposes). If the property goes through to foreclosure sale and no debt is forgiven, then I don’t think the deficiency qualifies as canceled debt for 1099 purposes--frankly, because the bank can still come after you personally for the deficiency post foreclosure (so how would that be canceled debt???).
The information in this answer is not intended as legal advice nor do I intend to create an attorney-client relationship with any reader simply by answering this question or contributing as a member of AVVO.