Help

I'm trying to get a command that kills anyone who tries to kill a peaceful or neutral entity. Can someone help me? Thanks.