Welcome to Just Answers, I will do my best to Answer your Question.
The banks loss... will be a "gain" in the State Franchise Tax Boards and the IRS "eyes"
There's only one exemption, that's owner occupied.
If this is under a business entity, such as an LLP or LLC or a Corp of any type, you would be able to expense against the gain. But if you are sole owner, then you will have to expense out what was spent against the gains.
Due to the complexity of your return, I recommend a CPA or an EA to complete your taxes. They have ways to help with eliminating your liability, even if you are insolvent, they will be able to bring it down to "maybe" to zero.
But, to start off you will be liable until the financial math is applied which can not be answered in this type of forum.
A complete financial profile and the computerized calculations will be the only way to provide you with the information you need to file.
Thank you for your patients on waiting for an answer.
I live in California, I practice in California, but all tax preparer are qualified to answer Federal Tax Question and most states as well except for states that require separate licenses such as California.
Take care and I hope the best for you.
what does this mean?
"But if you are sole owner, then you will have to expense out what was spent against the gains."
I am a sole owner.
What ever it cost you to obtain the property, as well as maintain the property can be expensed against any income on the property including a 1099c (if you receive one)
I have to go to a hearing for a client... I will check email later in the day.