I have difficulty grasping the rules about when to use that and when to use which. Is the following sentence correct?

"I still marvel at the peculiar quirks and exceptions to almost every rule of grammar, which exasperate even native
English speakers"

Thank you for your help!