Multiple action or loop for pir sensors? I need help

Hi Im new with arduino and Im creating new project with arduino uno
Project name is stairs light with two pir sensor

Im using 2 pir sensor one of is upstairs (pirPin2) other one is downstairs (pirPin)

if pirPin detect a movement lights goes on to upstairs and pirPin2 detect a movement lights goes off from down to upstairs.

I know this is very basic, maybe silly but my question is how can I reverse this loop? I cant add second loop or something like this

so Ineed help for this I want to do this if pirPin2 detect any movement lights goes on to downstairs and pirPin detect any movement lights goes to down from up.

My codes are below you can see my codes

I hope its clear if you could help me I will be happy

int calibrationTime = 10;

//the time when the sensor outputs a low impulse
long unsigned int lowIn;

//the amount of milliseconds the sensor has to be low
//before we assume all motion has stopped
long unsigned int pause = 5000;

boolean lockLow = true;
boolean takeLowTime;

int pirPin = 7; //the digital pin connected to the PIR sensor’s output
int ledPin1 = 8;
int ledPin2 = 9;
int ledPin3 = 13;
int ledPin4 = 12;
int ledPin5 = 11;
int pirPin2 = 6;

void setup(){
pinMode(pirPin, INPUT);
pinMode(pirPin2, INPUT);
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
pinMode(ledPin4, OUTPUT);
pinMode(ledPin5, OUTPUT);
digitalWrite(pirPin2, LOW);
digitalWrite(pirPin, LOW);

//give the sensor some time to calibrate
Serial.print(“calibrating sensor “);
for(int i = 0; i < calibrationTime; i++){
Serial.println(" done");
Serial.println(“SENSOR ACTIVE”);

void loop(){

if(digitalRead(pirPin) == HIGH){
digitalWrite(ledPin1, HIGH);
digitalWrite(ledPin2, HIGH);
digitalWrite(ledPin3, HIGH);
digitalWrite(ledPin4, HIGH);
digitalWrite(ledPin5, HIGH); }
//makes sure we wait for a transition to LOW before any further output is made:
lockLow = false;
Serial.print(“motion detected at pirPin2 “);
Serial.println(” sec”);
takeLowTime = true;

if(digitalRead(pirPin2) == HIGH){
digitalWrite(ledPin1, LOW);
delay(500); //the led visualizes the sensors output pin state
digitalWrite(ledPin2, LOW);
digitalWrite(ledPin3, LOW);
digitalWrite(ledPin4, LOW);
digitalWrite(ledPin5, LOW);}

lowIn = millis(); //save the time of the transition from high to LOW
takeLowTime = false; //make sure this is only done at the start of a LOW phase
//if the sensor is low for more than the given pause,
//we assume that no more motion is going to happen
if(!lockLow && millis() - lowIn > pause){
//makes sure this block of code is only executed again after
//a new motion sequence has been detected
lockLow = true;
Serial.print(“motion ended at “); //output
Serial.print((millis() - pause)/1000);
Serial.println(” sec”);