Note that these are two different cases.
Philander Castile was a licensed concealed carrier with no criminal history who was stopped for an allegedly broken tail light. He was shot and killed by the officer while obeying all of the officers commands. Based on the video, there was clearly no way that lethal force was justified. The officer who shot him should be charged.
Alton Sterling was confronted by officers after they arrived to investigate a “man with a gun” call. He was uncooperative and resisted. The officers tried to taser him. While being tackled by the officers, one officer discovered that he had a gun and the other one shot him shortly thereafter while he was still resisting but sort of under control by the officers. Was lethal force was justified? Based on the video, I would say no. The officer who shot him should be charged.