How to link a weapon to the players head movement?

You need an Aim Offset.