There are several ways to do it. This is easiest way I know.
In the Event graph of the enemy character, get the player’s location location:
And in the AnimGraph, rotate the head bone using the “Look at” node:
With “Look At Clamp” of the “Look At” node, you clamp the rotation in all axis.
With “Alpha” you control the strenght. So you can set this value depending on the player’s distance (*alpha *= 0: no rotation else: rotation)