The prefix e- (or ex-) usually means "out of" or "from." The prefix im- (or in-) often means "in" or "into."
Therefore, emigrate means "to move out of" and immigrate means "to move into."
Correct: They emigrated from Rwanda and immigrated to Gabon.
Note: The prefix e- comes from the Latin word e, such as we see in the motto of the United States: "E pluribus unum" (Out of many, one).