The wiring diagrams on this page make use of 4 way switches, in combination with two 3 way switches, to control lights from three or more locations. To control lights from two locations, only, use the 3 way wiring at this link. Also find diagrams to wire multiple light fixtures in these circuits at this link and troubleshooting tips for 4 way circuits, and 3 way switches at these links.
Note: The neutral source wire in these circuits will always be connected to the light fixture neutral terminal, either directly or through splices in each switch box. The ground wire should be spliced to each device, and any outlet box that has a metal grounding terminal. When using the white cable wire to carry current between devices, it should be wrapped with electrical tape to mark it as hot. These diagrams illustrate 15 amp circuits using 14 awg wire. For 20 amp circuits use 12 gauge wire and switches rated at 20 amps.
This diagram illustrates wiring for a 4 way circuit with the electrical source at the light fixture and the switches coming after. Two-conductor cable is run from the light to SW1 and 14/3 cable runs between the switches. The hot source is spliced through to the common terminal on SW2 and the hot terminal for the light fixture is connected to the common on SW1. The travelers run from SW1 to the input on the 4–way and from the output to SW2.
In this drawing the source for the circuit is at the first switch and the hot wire connects to the common on SW1. Three-conductor cable runs between the switches and 14/2 cable runs from SW2 to the light fixture. The common on SW2 is connected to the hot terminal on the light. The travelers run from SW1 to the input on the 4–way and from the output to SW2.
This wiring shows the light fixture and the electrical source in the center of the circuit. Three-conductor cable runs throughout and the hot source is splice to the common on SW1. The common on SW2 is spliced through to the hot on the light fixture. The travelers from SW1 are spliced at the fixture outlet box to run to the input on the 4–way. The 4–way comes right after the light fixture, but before the second 3–way switch, making it fall between the two 3–ways as needed. It could also be installed on the other side of the light and the effect would be the same.
Here two 4–way and two 3–way switches are used to control lights from four different locations. The source is at SW1 and the hot wire is connected to the common terminal. 14/3 cable runs between all switches and 14/2 runs to the light from SW2. The light hot connects to the common terminal on SW2. The two 4–ways occur between the 3–ways and the traveler wires run from SW1 to the input on the first 4–way. The output is wired to the input on the second 4–way and the output from there to the traveler terminals on SW2.
This is the wiring for a dimmer in a 4 way circuit. To make this circuit work, a 3 way dimmer is used in place of one of the standard 3 way switches. A dimmer can be added in this way to any of the circuits on this page. These devices have 4 wires: one common, two travelers and a ground. The common wire is usually black and the travelers red, in any case, the traveler wires will usually be the same color to distinguish them from the common.
In this diagram the source is at SW1 and the hot is connected to the common terminal. 14/3 cable runs between the switches and 14/2 runs from the dimmer to the light fixture. The travelers from SW1 run to the input on the 4 way switch and the output is spliced to the traveler wires on the dimmer. The dimmer common wire is spliced to the hot terminal on the light.
A 4 way switch must be wired between two 3 ways as shown in the diagrams on this page. A 4 way has five connections, one ground and 4 circuit terminals divided into two matching pairs, sometimes called the input and the output. The terminal pairs may be different colors or they may be labeled to distinguish them from each other. Each pair of terminals should be wired to the traveler wires from one of the 3 way switches. The travelers can be wired to either terminal in a pair, but don't mix up the pairs or the circuit won't work properly.
In order for a 4–way circuit to work the 3–way switches must be wired properly at the the beginning and end of the path. So be sure that the common terminal on one of the 3–ways is wired to the hot source and the common on the second 3–way is wired to the the hot terminal on the load. Check to be sure the traveler wires only connect between the traveler terminals on the switches. Also be sure the neutral from the source is connected to the neutral terminal at the load, only. A neutral wire should never be connected to any switch in these circuits.

Troubleshooting 3-Way and 4-Way Switches
Detailed explanation of the design and function of 3 way and 4 way switches.
thecircuitdetective.com
How a 3-Way Switch Works
Illustrations and description of how a 3-way switch works.
howstuffworks.com
How to Wire a 3-Way Switch
Diagrams and description of how to wire a 3-way switch.
homeimprovementweb.com