Metro Exodus has two endings. Check this chapter to learn about their criteria and see what you have to do to get the good ending.
How to get the good ending in Metro Exodus?
To get the good ending in Metro Exodus, at least two of your friends must survive until the end. The characters that can die during the game are Duke, Damir, and Alyosha. At the end of the game, Artyom will need a blood transfusion - this requires more people to be present during that moment. If you persuaded/helped your allies - Artyom will live. He will become the new leader of the Order, and you will get the good ending.
How to get the bad ending in Metro Exodus?
The bad ending is only possible if you don't have enough people for the blood transfusion. In the afterlife, Artyom will meet a few familiar people from the past (Bourbon, Khan). After that, you will see a cut-scene from Artyom's funeral.