Ad hominem Latin for "to the man” (argumentum ad hominem) is an attempt to invalidate all or parts of an opponent’s argument by linking an action, characteristic, or belief of the opponent advocating the perspective. The ad hominem can be a classic logical fallacy, but it is not always fallacious. For in some instances, questions of personal conduct, character, motives, etc., are legitimate and relevant to the issue. Additionally an insult is not related to the argument is simply an insult and not an attack on the argument.
In the end the an hominem is a logical fallacy only when the attack is an attempt to invalidate an argument by distraction from the actual content of the argument. An insult not related to the content of the argument my well be offensive and rude but not an ad hominem. Additionally an ad hominem may well contain valid criticism if the attack can be proven to have an impact on the content of the argument.