Two-way wiring switch is used to control a lamp from two different locations. The figure below displays the connections for this type of wiring:
Work Flow
At instant suppose the light is turned on. If any position of the switches is changed then the LED (Lamp, bulb) will turn off. Again if switching position is changed the lamp will again start glowing.
Practically such switches are employed in long halls or corridors, and staircases where two switches (each at one end) of the corridor are installed so that user can switch on while entering the corridor (stairs) and switch it off from another end while leaving it.
More to read