Put a +1/+1 counter on target creature you control if it's legendary. Then it fights target creature an opponent controls. (Each deals damage equal to its power to the other.)
If either target is an illegal target as Ancient Animus tries to resolve, neither creature will deal or be dealt damage.
If the creature you control is an illegal target as Ancient Animus tries to resolve, you won't put a +1/+1 counter on it. If that creature is a legal target but the creature you don't control isn't, you'll still put the counter on the creature you control if it's legendary.
The creature you control doesn't have to be legendary. It simply won't receive a +1/+1 counter before it fights if it isn't legendary.
You can't cast Ancient Animus unless you choose both a creature you control and a creature you don't control as targets.