Figuring out what magnesiums works best for you will be a trial/error. Loose stools means that you are eliminating excess mag that is not being absorbed. Switching to mag glycerinate or dosing your mag citrate in divided doses throughout the day may help that. If you're taking the citrate all at once before bedtime, that may be too much.
Like I've stated above and as MRS. D points out, chronic diarrhea/loose stools can cause an imbalance in other electrolytes.
Here are some articles on the use of glycine I suggested.
http://www.sciencedaily.com/releases...0327172155.htm
Also, B vitamins can help too.