Magnesium malate is a good form, but I can't use it before bed. Magnesium citrate is good for me then, though some people use magnesium taurate or glycinate before bed. My bowel tolerates malate slightly better than citrate. So far, ReMag is on the form that gave me absolutely no bowel problems. Even magnesium bicarbonate, called "magnesium water," which you get by mixing Milk of Magnesia into seltzer water and which is not supposed to affect the bowel, ultimately does affect my bowel.
So you push all the magnesium forms til the stool is very soft and no further. Sometimes what you eat will then cause more firmness or looseness, but you always have a center to go back to.