Laws differ, I don’t know what they are like there. In most of the USA you can use reasonable force to eliminate a threat.
Not “they (said) had a gun so I get to kill them”, but “they (said) they had a gun so I shot them until I realized they were no longer able to use that gun to shoot me”
In both cases they end up dead, but in many places the difference between “they ended up dead so I could be safe” and “I decided killing them would make me safe, so I did it” is also the difference between “self defense, you are free to go” and “manslaughter/some other lesser murder charge, free room and board from the state”
(NOTE: I’m not a lawyer, I had a law class or two in HIGH SCHOOL decades ago, take to a real lawyer if possible before you kill anyone, good luck!)