Like in belIEve, fIErce, collIE, dIE, or frIEnd.
But flip "ie" if it's after C, like in deCEIve, CEIling, reCEIpt, or CEIlidh.
There are a few exceptions to this rule, though, like in speCIEs, sCIEnce, suffiCIEnt, or sEIze, wEIrd, vEIn, thEIr, forEIgn, or fEIsty.
In fact, in the default dictionary for Mac OS X 10.10, there are 2717 exceptions to this rule, and only 3901 words that follow it (full list below).
In other words: if you're trying to decide if a word should be spelled with "ie" or "ei," following this rule will only help you guess correctly 6 times out of 10.
The wikipedia article on this rule cites a continuation of the rhyme that helps you guess better:
or when sounding like A, as in neighbour or weigh
which does restrict the exceptions, but the primary lesson from this is that english is wierd.