Can,t change status when start while loop

Hello,
I'm make push button to on / off button, and traffic light. I want when I push button first time then traffic light start, and when I push second time trafic light stop. When push first time, traffic light start. But when I push second time traffic light keep working. I cant change status when while loop is active.

This is my code:
int ledr = 13;
int ledg = 11;
int ledy = 12;
int button = 2;
int status = false;
void setup() {
pinMode (ledr, OUTPUT);
pinMode (ledg, OUTPUT);
pinMode (ledy, OUTPUT);
pinMode (button, INPUT_PULLUP);
}

void loop()
{

if(digitalRead(button) == true)
{
status = !status;
while (status == true)
{
if (digitalRead(ledg) == LOW && digitalRead(ledy) == LOW)
{
digitalWrite(ledr, HIGH);
delay(10000);
digitalWrite(ledr, LOW);
}
if (digitalRead(ledg) == LOW && digitalRead(ledr) == LOW)
{
digitalWrite(ledy, HIGH);
delay(1500);
digitalWrite(ledy, LOW);
}
if (digitalRead(ledr) == LOW && digitalRead(ledy) == LOW)
{
digitalWrite(ledg, HIGH);
delay(10000);
digitalWrite(ledg, LOW);

}
}
}
while (status == true)
{
if (digitalRead(ledg) == LOW && digitalRead(ledy) == LOW)
{
digitalWrite(ledr, HIGH);
delay(10000);
digitalWrite(ledr, LOW);
}
if (digitalRead(ledg) == LOW && digitalRead(ledr) == LOW)
{
digitalWrite(ledy, HIGH);
delay(1500);
digitalWrite(ledy, LOW);
}
if (digitalRead(ledr) == LOW && digitalRead(ledy) == LOW)
{
digitalWrite(ledg, HIGH);
delay(10000);
digitalWrite(ledg, LOW);

}
}
while(digitalRead(button) == true)
{
delay(50);
}
}

In your while loops (why do you have 2 of them with the same condition ?) you do not read the input (HINT) so status does not change and so the while loop does not exit

By the way, your duplicate post in another forum section has been deleted

Cross-posting is against the rules of the forum. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend 15 minutes (or more) writing a detailed answer on this topic, without knowing that someone else already did the same in the other topic.

Repeated cross-posting will result in a timeout from the forum.

In the future, please take some time to pick the forum board that best suits the topic of your question and then only post once to that forum board. This is basic forum etiquette, as explained in the sticky “How to use this forum - please read.” post you will find at the top of every forum board. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

The delays in the code will make the program unresponsive.

Here are tutorials that show how to do timing with millis() and writing non-blocking code.
Several things at a time.
Beginner's guide to millis().
Blink without delay().

The state change detection tutorial shows how to act on the transitions (versus levels) on digital pins. Makes it easy to toggle a state (push on, push off).