Small ldr project turns into a nightmare

I'm sure everyone knows the basic ldr project lights go off led turns on, very simple. What I am trying to do is lights go off green led turns on. Lights go back on. Lights go off green turns off red led turns on. Then next time red turns off green on . So every time it just switches green to red or red to green . Easy peezy.. nope I have tried verything. The closest I can get is when it's dark they blink back and forth landing at one randomly when the lights come back on. I'm getting nowhere.

Thanks for Your report, sorry things are not working the way You want.
Now You have to advice me how I would find out what's wrong?

Does this do what you want? It uses the state change detection method to detect the low to high transition or when the light changes from light to dark versus when it is dark or light.

const byte redLedPin = 3;
const byte greenLedPin = 4;
const byte ldrPin = 2;

void setup()
{
   Serial.begin(115200);
   pinMode(redLedPin, OUTPUT);
   pinMode(greenLedPin, OUTPUT);
   pinMode(ldrPin , INPUT_PULLUP);  // internal pullup for ldr load resistor*
}

void loop()
{
   static boolean lastldrState = LOW;
   static boolean count = false;
   static unsigned long timer = 0;
   unsigned long interval = 100;
   if (millis() - timer >= interval)
   {
      timer = millis();
      boolean ldrState = digitalRead(ldrPin);
      Serial.println(ldrState);                       // ****  Note:  LOW for light on
      if (ldrState != lastldrState)
      {
         if (ldrState == HIGH)
         {
            count = !count;  // toggle the count variable
         }
      }
      lastldrState = ldrState;
      if (count == true)
      {
         digitalWrite(redLedPin, HIGH);
         digitalWrite(greenLedPin, LOW);
      }
      else
      {
         digitalWrite(redLedPin, LOW);
         digitalWrite(greenLedPin, HIGH);
      }
   }
}

*The internal pullup often works for me, change to external resistor to adjust sensitivity for your use.