The code is put together by a committee and revised every three years. The updated code is published and can be purchased. However, it is not assembled in a user friendly way. It might be more useful to look at the interpretation of the original code. It is available in several different formats and editions published by several private companies.
In most cases the electrical power comes from the utility company power line via a transformer. The wires that come from the transformer may be hanging overhead or in a conduit underground. The size of these wires determines the maximum amount of electrical power that can be fed to that particular user. The wire then connected to an over-current protection device, a main breaker or a fuse. In modern residential construction device is a main breaker that is part of the main electrical panel. Usually the power company electric meter is part of this panel too. The meter is connected between the main feed and the main breaker and it measures the amount of power used by that household.
The main electrical panel feeds the different circuits in the house via individual breakers , one for each branch circuit. In some cases there might be other panels installed to feed a particular part of the residence. Each of these sub-panels are fed by one of the breakers in the main panel. It is usually done if the residence is large or an addition was built as part of a remodeling project. It might be more economical to pull one set of higher gauge wires than several smaller gauge, one for each circuit.
Each branch circuit is dedicated to a specific task. The purpose of the circuit determines the size of the wiring and the breakers. It is extremely important that the rating of the breaker does not exceed what the particular size conductor can deliver safely. It is acceptable to have a breaker rated lower than the wire but not the other way around. Sometimes it is beneficial to use an oversized conductor. It will lower the voltage drop for long runs.
The most common circuits feed lighting and general purpose outlets. In older homes these circuits are shared. A branch circuit may feed some light switches and some outlets at the same time. It is a good idea to separate circuits out based on their functions and destinations. Doing so will make circuits work better and troubleshooting becomes much easier.
Some other circuits serve a specific purpose. They may feed an electric dryer, the stove or the air conditioner. In this case the conductor size, the location and the receptacle need to be designed for the specific situation.
The outlets at certain locations need to be protected by Ground Fault Circuit Interrupt (GFCI). The protection is usually done by the device being built into the outlet itself. The device is only needed in the first outlet of the chain. May times they are installed redundantly. That is not the correct way and does not provide more protection.
Starting with NEC code of 2008, certain circuits (bedroom) need to be protected by Arc Fault Circuit Interrupt (AFCI). This type of protection is usually done by the protection built into the breakers. These breakers are significantly more expensive than their simple counterparts. Therefore they are only used where they are required. There is also an issue with these devices if they feed certain loads they tend to trip. The reason is related the way they work. AFCI devices “listen” for frequency components of the electrical current flowing through them that are signatures of a broken wire or some other fault that causes arching. If the load generates similar spectral content the AFCI thinks there is arching and trips the branch circuit connection.