Here is a short tutorial on how to plumb your home, especially including some of the (surprising) code requirements.