However, there are a lot of people who get genuinely confused by this. So let me explain what's going on.
Let's take a random verse you cited -- let's look at Leviticus 20:13. In fact, just read all of Leviticus 20.
The context is simple. God is telling Israelites how they are to behave when they live in the land that God set aside for them. Emphatically, he is telling them: DO NOT ADOPT THE PRACTICES OF THE LOCALS. Every thing he mentions in 20 was a practice of the locals, abominations, all of them, and he is quite clear that people are doing these things to worship Moloch and the other gods of the land. And God has a ZERO TOLERANCE towards these things, so much so that he wants people to kill others over it.
Then, a few chapters later, God is suddenly talking about "sin offerings". What is this? Apparently, in the Law of Moses, if you break the commandments, there is an "out". If you turn back to God and offer a sin offering, your sin can be erased. In other words, if you would have otherwise been guilty of death, you can observe the sacrificial rituals and become clean and forgiven again.
So, let's say I get caught worshipping Moloch, doing all sorts of nasty sex crimes and such. The Israelites that live around me are fully justified if they outright kill me. I'd get blamed for my own death. But they don't necessarily have to. If I genuinely repent and turn back to God, and participate in the cleansing forgiveness sacrifices, I can get my slate wiped clean. This was God's intent all along -- reclaim the sinner, not murder them.
WEIRD, HUH? That's not what your atheist friends told you, is it? It's because they can't read the whole Bible, only the parts they don't like.
Furthermore, you can read about the process of how someone who commits murder is to be put to death. Specifically, the brothers of the victim are to hunt down the murderer, and there are rules about how and where they may kill the murderer. If the murderer flees to a sanctuary city, then they can't enter the city and must ask the elders to send the murderer out to be killed. The elders are supposed to hold a trial and decide whether to send the murderer out or to let him stay until the next Jubilee every 70 years. If the murderer stays in the city, he cannot be killed for murder. And when the Jubilee happens, he is free to go and cannot be killed.
Furthermore, the murderer's family can go to the victim's family and plead for mercy. If the family promises mercy to the murderer, then they signify this by an oath and make all the brothers promise not to hunt down the murderer.
WEIRD, HUH?
It's almost like reading a few verses in isolation gives the wrong idea about how God wanted to order things and arrange them.
To wit -- God is asking us not to go after other gods. He wants us to serve him first and foremost. Furthermore, he wants us to love and forgive each other. He wants us to ask for forgiveness. He wants us to change our lives and live in peace with our neighbors.
He is not and never was a murderous God. He always provided plenty of "outs" that didn't involve shedding blood, even guilty blood. Compare the God of Israel with all the other gods in the world at the time, and YHWH comes out looking really, really awesome in comparison.