When wiring a three way switch, what gets connected?
A three way switch has three current carrying terminals plus a ground screw. One terminal is the common, usually a dark or black colored screw, and it is electrically different from the other two. The remaining two terminals are the travelers, normally brass colored and interchangeable with each other. The line hot lands on the common of the first switch, the switch leg to the light leaves from the common of the second switch, and the two travelers connect switch to switch.
The standard layout
Power arrives at switch box one. The ungrounded hot conductor terminates on the common screw of switch one. A three conductor cable runs from switch one to switch two carrying the two travelers plus the neutral. The travelers land on the brass terminals of both switches in any order. At switch two, the common screw feeds the ungrounded conductor that runs to the fixture. The neutral passes through both boxes and continues to the fixture without being switched, because 404.2(A) requires the switch to break the ungrounded conductor, never the grounded one.
Two other layouts show up in the field. Power at the fixture with a switch loop is common in older work, and power at one switch with the fixture between the two switches shows up in remodels. In both, the rule is the same: the common terminals bracket the whole switching arrangement and the travelers stay between the two switches.
NEC 2023 rules that catch people
Section 404.2(C) requires a grounded conductor at most switch locations that control lighting loads in dwellings, which is why three conductor cable between the switches is now standard rather than optional. The neutral is there to power electronic switches, dimmers and smart devices, and it must be present even if the switch you install today does not use it. There are limited exceptions where the raceway is large enough to add one later or where the box is accessible from an attic or crawl space.
If a white conductor is used as a traveler or as a switch leg, 200.7(C)(1) requires it to be permanently reidentified at every point where it is visible, using tape, paint or a marker sleeve of a color other than white, gray or green. Section 404.9(B) requires the metal yoke of the switch to be grounded, and 300.3(B) requires all conductors of the same circuit to run in the same raceway or cable.
Adding a four way
Control from three or more locations puts four way switches between the two three ways. A four way has four terminals in two traveler pairs and no common. The travelers come in on one pair and leave on the other, so you need a three conductor cable into and out of every four way box.
Field takeaway
Common gets line or load, brass terminals get travelers, neutral runs through unswitched, and any white conductor used as a hot gets reidentified.