(Solved) ir remote relay control

is this what you meant?

It's what I meant by putting each { on a new line and formatting. You did not move the added code into the right place, though.

  else if (results.value == 0xF1B1) 
  {
    if (millis() - last > 250) 
    {
      on = !on;
      digitalWrite(relay2, on ? HIGH : LOW);
    }
    last = millis();
  }

and the similar blocks after it need to go BEFORE

    irrecv.resume(); // Receive the next value
  }

You may well need to have different time and state variables for each button, too. It seems that you maybe want to prevent multiple presses of the same button within a specified period, but you should, I think, be able to press different buttons in that same period.