Build a humanoid robot is something difficult. There are many calculations of mechanical, electronic and software / program used to make the robot can move very well as expected.
The following documents contain teory to build a humanoid robot. This document is an old document, but you can use as reference for making humanoid robots, especially in the mechanical section.
Here the document preview:
Download the original document from MIT: