Maybe I can suggest some logic?
With both buttons using INPUT_PULLUP and wired to GND
so that LOW is down and HIGH is up...
If the output is OFF and either button changes from HIGH to LOW,
that button becomes the ON button, the output turns ON and only if the other button changes from HIGH to LOW does the output turn OFF.
Perhaps for testing, use the Arduino onboard led as the output?
That leaves details to fill in but does it describe what you want?
My suggestion is to set up global byte variables for:
output pin number
output state
output previous ON button == 255
output current ON button == 255
these two are to allow complex over time output actions taken
input pins numbers
input pins previous read and current read states, that start HIGH
make these variables arrays, if you add buttons you make the arrays bigger and the code won't need to grow.
number of inputs
input pin array index, start with 0
input pin pressed first to make output ON
And then in void loop
read one button, the index button into the index current state. If the index previous state == HIGH and the index current state == LOW, the index button was pressed.
If the button was pressed then
if output On button == 255, it becomes the index
else
if the ON button is the same button, ignore the press
else
the ON button has to be a different index, make it 255
set the index previous state = index current state
if index < number of inputs, index++, else index = 0
That is the input code, the output code in void loop is
If previous ON == 255 and current ON != 255
set output HIGH or begin complex output actions
else
if previous ON != 255 and current ON == 255
stop the output
set previous ON = current ON
finished, the input and output parts run over and over in loop()
This will give you code that you can modify to do more.