Room automation light control - programming problem

  pinMode(doorSensor, INPUT);

Is this the door switch? If so, you aren't using the internal pullup resistor. This means you have an external resistor, right?

back:
  if (doorSensor == true){
    Serial.println("Door Sensor True");
    digitalWrite(mainLightOn, HIGH);
    delay(1500);
    digitalWrite(mainLightOn, LOW);
    goto back;

NO! NO! NO! There is no reason whatsoever to be using a goto. The loop function will be called again. There is no reason to use convoluted logic to get back to the start of loop().

My problem is that I can't get it to work the way I want it to.

How is that? What is the code doing?