Welcome to icliniq.com.
Please note that children below the age of 6 months pass stools either once in two to three days or 10 to 15 times per day. It is normal, and it is not labeled as loose motions or constipation. If you are labeling it as constipation because of hard pellet like stools, then I would advise you to increase the water content of the top feeds and see.
As far as the gas problem is concerned, it is also normal. Nothing is to be done. Almost all babies have gas just like a normal adult. There is no medicine for the same because it is normal. You can calm down a crying baby by either singing (light tones), suckling (allowing baby to suckle), swaddling (wrapping the baby in cloth), swinging (putting the baby in a small too and fro motion). You can also tap slowly on the stomach to reduce discomfort as and when required.