I don't think the image posted is anywhere near the logic necessary to even just turn the lamp on, but I am unsure what the ⇑ symbol means; is it an edge detector? You should try
Rubber Duck Debugging on your logic, i.e. describe to yourself, or a rubber duck, or to the forum, how you thought that logic should work.
Or you should start over: to solve the problem we need but one rung to create the logic that satisfies the word problem, with one extra branch to turn on the light in addition to the first output branch that control the seal-in bit. And we don't need any edge detectors.
See
De Morgan's Laws.
"If S1 and S2 are pressed, then Lamp will [i.e. is] off" ≡ "If
BOTH (S1 is 1) AND (S2 is 1) then LAMP is off"
Apply De Morgan's law
"if (
BOTH S1 is 1 AND S2 is 1) then (Lamp is 0)" ≡ "if (NOT (EITHER (S1 is NOT 1) OR (S2 is NOT 1))) then (Lamp must be 0)"
Since S1 and S2 are boolean (bits), we can translate "is NOT 1" to "is 0" and get the following:
"if (BOTH S1 is 1 AND S2 is 1) then (Lamp is 0)" ≡ "if (NOT (EITHER (S1 is 0) OR (S2 is 0))) then (Lamp must be 0)"
We can invert the NOT in the if-expression if we invert the then-expression:
"if (BOTH S1 is 1 AND S2 is 1) then (Lamp is 0)" ≡ "if ((EITHER (S1 is 0) OR (S2 is 0))) then (NOT (Lamp must be 0))"
Finally, we remove the NOT from the then-expression:
"if (BOTH S1 is 1 AND S2 is 1) then (Lamp is 0)" ≡ "if ((EITHER (S1 is 0) OR (S2 is 0))) then (Lamp may be 0 or 1)"
Since "Lamp may be 0 or 1" if "either S1 is 0 or S2 is 0", in that case (either S1 is 0 or S2 is 0), the original "if S1 is pressed and S2 is off, then turn on the lamp, and leave it on even if S1 is released" logic can control the lamp.
So the original word problem becomes
"if (EITHER ((S1 is pressed) AND (S2 is NOT pressed)) OR (Lamp is already on)) AND (EITHER (S1 is NOT pressed) OR (S2 is
NOT pressed)) then (Lamp is on)"
Note also that the first "
(S2 is NOT pressed)" is made redundant by the second, and so the first can be removed.
All that remains is to code that word problem into ladder logic.
This is a long-winded reply, but this is how to do boolean logic. That said, once you are facile with boolean logic, this kind of thinking happens very quickly.