Firstly, diarrhoea means passing watery stools, look at the consistency of stools, are these extremely thin and water like or these are semi solid?
And loose stools twice a day is not much to worry about, dehydration due to watery stools can occur only after passing multiple such stools / day and not giving enough intake ( breastmilk) during diarrhoea episodes.
For now you can ensure timely breastfeeds, including night time feeding as well, also if you want to continue giving formula feeds , don’t use bottles, rather use spoon and katori and wash them after every use.
Next Steps
Lactose intolerance can be diagnosed after certain tests performed on stool sample. You can take proper consultation for this.