E.B.
This advice has been given a lot previously, but it bears repeating.
From now until the GI appt, keep a food log. Be very specific (not "snack" but "1 peach and 5 Saltine crackers". Not "dinner" but "1 bowl rice with sauteed chicken" or 5 Tyson chicken nuggets and a handful of baby carrots, and Jello pudding for dessert, with a glass of milk", for example). Write down the time of day and then write what bathroom issues occurred, and when.
I found it easiest to buy a simple notebook and make each page one day. On the left, write the times, and in the center, write the details. Your GI will find this tool very useful.
Also, a very easy thing to eliminate for bowel and GI issues is all sources of sorbitol. If he has any food products that are sugar-free or sweetened with sorbitol or mannitol or anything ending in "itol", cut those out immediately. No artificial sweeteners at all. Also remove natural sources of sorbitol, which are apples, cherries, red or purple grapes, some sea weeds. Read every label. Kiwi Strawberry Juice often has apple and pear juice as its first ingredients, as an example. Give him 100% unsweetened white grape juice if he wants a juice drink (green grapes don't have sorbitol). It's good that your pediatrician is on top of things - you need your son to be on gluten in order to do more extensive tests.
I know, it's difficult. Hang in there.