In the Matrix, especially the scene on the rooftop in part 1, when Neo is shooting at the agent who is dodging Neos shots using the 'bullet time' move the agent is only moving from the waist up. Why not shoot the agent in the legs also, what happens when you shoot an agent?
As to what happens when you shoot an agent, well the agent dodges your bullets, unless of course you manage to get a shot from point blank, in which case assuming it is a fatal shot the agent is forced out of the body it is occupying and will most likely enter a different body in the vicinity to continue trying to kill you.
The following is speculative since I seriously doubt there is a canon answer.
As to why agents do not move their legs there are two possibilities. The first is they would if someone ever shot at their legs but no one fighting an agent ever chose to go for an incapacitating shot so we never see it.
The second is that a leg shot simply would not matter to an agent, the agents are software taking over the avatars of people connected to the matrix, kill the avatar and the agent can no longer utilize it but any damage short of actually removing a limb will most likely not matter to an agents combat effectiveness. The human body experiences pain but its likely an agent could still chase you with a bullet in both kneecaps.