or when sounded as a,
as in ‘neighbor’ and ‘weigh’,
or when it appears in comparatives and superlatives like ‘fancier’,
or when the c sounds as sh as in ‘glacier’,
or when the vowel sounds like ee as in ‘seize’
or i as in ‘height’,
or when it shows up in compound words such as ‘albeit’,
or when it shows up in –ing inflections of verbs that end in e, like queueing,
or occasionally in technical words that have a strong etymological link to their parent languages such as ‘cuneiform’ and ‘caffeine’,
and in numerous other random exceptions such as ‘science’, ‘forfeit’, and ‘weird.’
That's because it's not taught correctly. It's supposed to apply to words that have an "ee" sound from blended vowels, because those are the words that are confusing to remember whether the i or the e comes first. And even then there are exceptions (weird, seize, Keith). It was never meant to cover words with an "ay" sound like weigh or where the 2 vowels are pronounced separately (science, glacier, being).
But it's much more fun to pick words that "disprove" the rule for Internet points (even though they were never meant to be in scope).
That's why the full rule that my English teacher grandmother taught me but surprisingly most people don't seem to know is "I before e except after c, but only if it rhymes with 'me'"