assett protection in bankruptcy

I own three homes ,one a 3600 sq ft home on 16 acres with a $324000 mortgage on it not currently occupied , another 1200 sq ft home with $100000 mortgage on it which is occupied by my wife and children we are currently separated I make the 800 pymt on that home i currently live in our third home which is about 1200 sq ft and no mrtgage on it.It is not in the best part of town also but its a home.my dilema is im about nine months behind on the larger home and badly in debt with credit cards etc im thinking of filing bankruptcy but dont know if i or my children will lose there home does any one have any experience in this area . the home is not selling and the bank will not modify or help

All your non-exempt assets will be sold to pay your debts and you are only allowed a homestead on your primary residence. Best to talk with a BK attorney in your state.

with me living in the one home would it be considered my primary residence?and my wife(soon to be ex) and children in the other would these homes be included (lost)

No one can give you a specific answer with the limited information you have provided. As BLL said, you need to consult a BK attorney in your state.