Red Shirt (dead guy) took the gun from White Shirt, then Blue Shirt who comes out of nowhere at the left of the frame was a bystander who saw the scuffle and shot Red Shirt with his own gun because he thought that Red Shirt was the aggressor who had pulled the gun.
Watch the other dude (also in a blue shirt) who spends most of the scuffle standing nearest to the bike. He goes up to Blue Shirt and holds his arms out as if to say, "Stop, he's not the guy you need to be worried about."
I could be wrong, but that's what it looks like to me.
You forgot the bit where the blue shirt fires a shot at the other blue shirts head and misses.