I copied this out of textbook.

It shows the different movements of the different parts of the legs.
I usually make a femur layer, a tibia layer and a foot layer.
I then put the axis of rotation at the end closer to the body.
Remember, we bob up and down a little when we walk.