Using the truth table
Consider the first toggle switch to be A and the second to be B and the output S which is the LED.
At the inputs of the toggle switch, consider the first terminal connected to the GROUND and the second terminal connected to the SOURCE.
SOURCE= 1
GROUND=0
A B S
0 0 0
0 1 1
1 0 1
1 1 0
s=A exclusive B
Explaining the truth table
For S1= GROUND and S2=GROUND output is 0 so the LED is off
So S1=A is toggled to GROUND and S2=B is toggled to the SOURCE so S=LED cames ON=1
S1=A is toggled to the SOURCE and S2=B is toggled to the GROUND so S=LED came ON=1
For S1=SOURCE and S2=SOURCE output is 0 so the LED IS off