IIRC, if you’re in the military and confess something to a military chaplain confidentiality pretty much goes out the window, at least if what you confess is a violation of the Uniform Code of Military Justice (UCMJ). That includes things that aren’t even illegal in the civilian world, so I wouldn’t tell my priest I was having an affair or was gay, etc.
If you tell someone like a psychiatrist that you are going to hurt someone, s/he is supposed to alert the authorities, but a Catholic priest would not if it was told to him in the confessional.
The priest would advocate stongly that the person not commit the crime, but if he were to tell the authorities, he would be looking at an immediate defrocking.