You've missed the second line of the mnemonic:
I before E except after C
but only when it sounds like EE.
OR a better way to get it right, according to me,is:
I before E, except after C or when sounded as A as in neighbour and weigh.
The spelling is related to the sound system