Twins can cause this type of pain under ribs due to pressure
As you are having diarrhoea
, you might be having amoebiasis
Get an ultrasound
For loose motions take rice , curd and banana in diet
Drink lot of water and electrolytes.
It is better to consult your doctor for diarrhoea as you might require IV fluids sometimes due to dehydration