The process is known as joint limiting,look up "Setting up joints for posing and animation" in the Maya help files.
Joint Limit Information attributes specify the minimum and maximum translation, rotation, and scaling values for a joint. You can set a joint’s limits if you want the joint to behave in a specific manner. For example, if you want to create an elbow joint for a human skeleton, you need to set its rotation limits so that it cannot rotate in X and Z, but can rotate only a specified amount in Y. Alternately, you can turn off transformation channels or use Set Driven keys to restrict the transformations of an object.
If you are using IK to pose your joints, you may want to set the degrees of freedom for your joints. The Degrees of freedom tool setting determines which local axes the joints can rotate around during IK posing and animation. You can set the degrees of freedom for a joint from the Joint section of the joint node attributes.
2 x Modeling Challenge Winner