This is an example of what is called “extreme
hyperbole”, as can be seen from the parallel passage in Matthew 10:37, which
glosses the statement as a command to love no one less than Jesus (rather than
to hate others).
You may also be interested in Does Luke 14:26 teach literal hate?