-or, -er words are in the family of easily confused endings and are often pretty annoying to spell and remember. “-ible and -able” words are like its slightly more evil cousins. However, there is a pattern to their spelling. However, as it is a pattern there may be some exceptions, but I haven’t seen any yet.
-or words tend to come from Latin and have much more Latin roots in general. On the other hand, -er words tend to have Middle English in the origin.
Ex:
Respecter –> Middle English
Abactor –> Latin
Condenser –> Middle English
Investigator –> Latin
Dictator –> Latin
Lawyer –> Middle English