More info would help… there are many ways to do this. If the 2 LEDs must be in sync (if one is on, the other is off) then you could make a circuit to handle this and use one output pin to drive it.
Place the LEDs in series and connect one end to 5V and the other end to GND. Then connect an output pin to the junction between them. When that junction is driven low (to ground), the first LED will light but not the second. When that junction is driven high (to 5V), the second LED will light but not the first.
Note that this setup means that 1 of the LEDs MUST be on. One way to solve this would be to drive the source to the series of LEDs also from a pin. That way one pin would be to enable the LEDs and the other would be to toggle which LED was lit.