Yes, homicide does trigger excommunication, but it's a little more complicated than that. There are two types of excommunication, as a reader explains:
It might be helpful to differentiate between latae sententiae excommunication, which is triggered by the commission of a proscribed act and exists even if the act remains undiscovered, and a ferendae sententiae excommunication, which is imposed by ecclesiastical authorities. But here's the key section of canon law:
Can. 1397 A person who commits a homicide or who kidnaps, detains, mutilates, or gravely wounds a person by force or fraud is to be punished with the privations and prohibitions mentioned in Can. 1336 according to the gravity of the delict. Homicide against the persons mentioned in Can. 1370, however, is to be punished by the penalties established there.
Can. 1398 A person who procures a completed abortion incurs a latae sententiae excommunication.