All ionic compounds have the metal first, and the nonmetal second. the nonmetal always ends in -ide. So lithium and nitrogen would create lithium nitride. nitrogen needs 3 electrons, and one atom of lithium can only give 1 electron. So, there needs to be three atoms of lithium to give 3 electrons to one atom of nitrogen. so, you put 3 in front of lithium to say that there has to be 3 lithium electrons. You don't put anything in front of nitrogen because there is only 1 atom needed. So, the formula will be li3n.