You are obviously some sort of expert on sin.
But the one thing that "God" cannot do is sin by killing anyone. He gets to decide wat is a sin and what isn't, cause he's like, G O D.
First Yahweh makes a deal with the Hebrews and defends them and gives them a ice piece of real estate. Or he tells them that he thinks they should kill some Canaanites and take it away from them.
Then Yahweh decides to abandon the Hebrews (now calling themselves Jews and later Israelites and says, "Now I am making a new deal with everyone now that I am Three-In-One, like the popular brand of sewing machine oil, and everyone needs to follow all three of me, including all the Jews, cause I wanna be a different sort of deity."
\