using "while" in the setup

Your while loop seems to say "while none of the buttons is pressed, if one of them is pressed then do something"
If I am right then does that make sense ?

The while() loop is very fast, and to be inside the loop no buttons can be pressed. That leaves a very small window of time to catch a button press. You do not test for multiple buttons pressed, so there is no need to have all the && conditions in your tests.

I would use a global boolean variable numberSelected, initialized as false, and let it control the while loop. As MorganS recommends, this can be placed in loop() instead of setup(), and anytime you want to re-enter the player selection set numberSelected back to false.

while (numberSelected == false) 
  {
    
    if (digitalRead(2) ==LOW)
    {
      numberSelected = true;
      playersNumber = 1;
      digitalWrite(8, HIGH);
    }
    if (digitalRead(3) ==LOW ) 
    {   
      numberSelected = true;
      playersNumber = 2;
      digitalWrite(9, HIGH);
    }
    if (digitalRead(4) ==LOW) 
    {
      numberSelected = true;
      playersNumber = 3;
      digitalWrite(10, HIGH);
    }
    if (digitalRead(5) ==LOW) 
    {
      numberSelected = true;
      playersNumber = 4;
      digitalWrite(11, HIGH);
    }
   
  }