Exceptions to the i and e rule

The trick to ie spellings is to know whether the source of the word is German or French. German started as a composite of many dialects, and had a major spelling reform that brought things into phonetic alignment.