In this case, we see if the wires from the power source enter one switch box at first, then go towards the light fixture and then to the other switch box. The white wire from the power source goes into the switch box first and then the light fixture. It terminates there without going to the second switch box. The diagram below shows how we can wire the switch in a case like this.
In building wiring, multiway switching is the interconnection of two or more electrical switches to control an electrical load from more than one location. A common application is in lighting, where it allows the control of lamps from multiple locations, for example, in a hallway, stairwell, or large room.
In contrast to a simple light switch, a single-pole, single-throw (SPST) switch, multiway switching uses buttons with one or more additional contacts, and two or more wires are run between the switches. When the load is controlled from only two points, single-pole, double-throw (SPDT) switches are used. Double pole, double throw (DPDT) switches allow control from three or more locations.
In alternative designs, low-voltage relay or electronic controls can switch electrical loads, sometimes without the extra power wires.