Magnesium citrate and magnesium oxide (often called elemental magnesium or buffered magnesium) are the forms to avoid unless you're trying to clean out your colon.
Look for Magnesium glycinate or magnesium bisglycinate, but be careful because some of those will include significant amounts of "buffered" or elemental magnesium.