Basic idea
A minimalistic circuit solution can be implemented with only three elements - a resistor and two LEDs; it is only necessary that the LED forward (threshold) voltages meet the requirements VLED1 + VLED2 > Vcc and VLED1 (VLED2) < Vcc. In the conceptual schematics below, I have modeled the LEDs by forward-biased "ideal" diodes with 2 V threshold voltages.
Conceptual 3.3 V diode circuit
The microcontroller output (not shown in the schematics below) consists of two complementary transistors which may not connect the output to the supply rails (high output impedance) or connect it either to ground (low output voltage) or to Vcc (high output voltage). I have modeled it here in the simplest possible way with a piece of wire.
High output impedance
In this case, the left hand resistor end is unconnected (floating). Although the string of two LEDs in series is connected between the supply rails, both LEDs are off since the overall threshold voltage of the string is higher than the supply voltage. No currents flow in the circuit.
simulate this circuit – Schematic created using CircuitLab
Low output voltage
Now the resistor is connected to ground; so a current flows through LED1 and it is on.
simulate this circuit
Middle output voltage
During the transition, when the voltage is between Vcc - VLED1 (1.3 V) and VLED2 (2 V), the circuit state is similar to the high impedance state - both LEDs are off and no currents flow.
simulate this circuit
We can see it in the DC sweep simulation.
This state is not essential in such a digital application because the microcontroller output voltage quickly jumps this 0.7 V "dead" zone, but it may have some analog application (LED voltage indicator).
High output voltage
Here the resistor is connected to Vcc; so a current flows through LED2 and now it is on.
simulate this circuit
All diode versions
Finally, let's investigate and compare the three versions proposed in the answers here.
Version 1: R-LED circuits shunted
Here, two R-LED circuits are connected in series to the power supply. The input voltage source (microcontroller output) shunts one circuit so its current is diverted and the LED is off, and connects the other circuit to the power supply so a current flows and the LED is on.
simulate this circuit
(+) Reliable LED shutdown
(-) Redundant resistor
(-) Requires VLED1 + VLED2 > Vcc
Version 2: LEDs shunted
In this case, only the two LEDs are connected in series to the power supply, and the two resistors are replaced by one common resistor. The input voltage source connects the resistor in parallel to one LED so its current is diverted and the LED is off, and connects the other LED to the power supply so a current flows and the LED is on.
simulate this circuit
(+) Only one resistor
(-) Requires VLED1 + VLED2 > Vcc
Version 3: Back-to-back LEDs
Here, a network of two LEDs in parallel, back-to-back, is connected between the input voltage source and the output of a .5x voltage divider supplied by Vcc. Thus, the right hand end of the LED network is "lifted" with Vcc/2, so the voltage across it tries to change from -Vcc/2 to Vcc/2 (but actually is limited to the voltage of the forward-biased LED).
Unsuccessful 3.3 V solution: Unfortunately, the (1.65 V) voltage across the forward-biased LED is insufficient to turn it on.
simulate this circuit
Successful 5 V solution: So, this configuration needs a 5 V power supply. Then a 2.5 voltage produced by the voltage divider is applied to the 2 V forward biased LED (the current is limited by the Thevenin divider resistance).
simulate this circuit
(+) Reliable LED shutdown
(-) Redundant resistor
(-) Requires VLED < Vcc/2
See also another related answer of mine.