This circuit is designed to switch between two power sources.
The primary power source (5V) is the master and has priority over the secondary.
I designed this circuit to avoid battery leakage current once the 5V USB is wire to the circuit.
On the output stage you will notice a resistor in series with a capacitor. It is just to limit the loading current in the cap once the 5V is disconnected.
This design is not a final design.
I will test this on a breadboard and keep you updated on the further modifications.