I whipped up a super basic rig that might help explain what you need.
Pick this project apart....
leggyEggy.moho
Rigging
Strength is set to zero for all bones except the leg bones. This because the body and feet are non-deforming so I just Layer bound these.
IK is used for the legs, and each leg bone chain points to a target bone.
The feet bones have Independent Rotation enabled to keep them from rotating freely. You can keyframe the feet rotation as needed.
The leg art uses Selective Flexi-binding. This is different from the default Flexi-binding in that the layers have been set to deform ONLY by certain bones. In this case, the right leg art is only deformed by the right leg bones and the left leg art is only deformed by the left leg bones.
To use Selective Flexi-binding, first select all the layers you wand to be deformed by certain bones, select those bones, and then choose Use Selected Bones For Flexi-binding.
(Note: if this doesn't work, you may have previously applied binding that's interfering. In which case, select the art layers and choose Reset All Bone Rigging. This will reset the rigging to the default Flexi-binding for only the selected layers. Now try the above again. If it still doesn't work, make sure these bones have some strength; flexi-binding doesn't work with zero strength.)
Animation
IK always likes to bend in a preferred direction which is defined by 'pre-bending' the bones. So if the knee joint is even slightly bend outward, the IK will try to bend in that direction. (Tip: you should test this on a non-zero frame. For various reasons, frame zero doesn't always work reliably for rig testing, notably IK testing.* I like to pick a nearby by frame like 12 or 24 for testing, and I use the Design Mode shortcut to hop back and forth between the frame and frame 0.) Note that the artwork doesn't need to be drawn in a bent pose, just bend the bones, and the bend can be smaller than what you see in my example file.
When you need to bend the joint in the opposite direction during animation, you need to keyframe the rotation of the bone. Use the Transform Bone tool and scrub over the bone to 'rotate' it until you see the bend direction change. You can adjust the animation to make this 'pop' imperceptible by lifting the character using IK, or by keyframing the length of a leg bone, or by just animating the motion quickly. Once you get the hang of this, you'll know exactly which to use and it will go quickly.
Animate the body by moving the root bone. This moves everything but the feet stay locked to the ground. Rotate the body by turning the body bone.
Animate the feet by moving the feet targets. Rotate the feet by rotating each foot bone directly.
This is a really simple rig but everything in it represents the foundation for pretty much any character rig I've build for a number of TV shows I've worked on.
Hope this helps.
-----
*You can test and see for yourself. In frame 0, grab the root bone and move it around using the Manipulate Bones tool. You'll probably see the knees bend in both directions uncontrollably. Now move to a later frame (say 12,) and do the same. Notice how now the knees only bend outward when you move the root bone.
Another tip: notice how I colored the target bones differently from the rest of the rig. This makes it easier to identify the target bones so I don't try to move the feet bones instead.