How to stop physics body falling through other physics body?

When I simulate physics, legs of my character falling through each other.

How can I stop physics body going through other physics body?