If a couple spilt up and later on of the parties decides to file bankruptcy can that person file bankruptcy on a house with a mortgage and both parties name on it?

You don't file bankruptcy "on" anything. You file for bankruptcy for all debts, including a mortgage or mortgages. If the other party has been paying the mortgage and has possession of the premises, there may not be a problem for that person.

If there is a divorce order requiring the absent party to pay or pay part of the mortgage, there may be a contempt action for violating that court order.