I am wondering which you think is the foundation of all sciences, I have no real understanding of either but I have a general idea of it I think so please offer your opinion!
Not that long ago the two were closely related and a PhD in math was / is a Dr. phil. The point of view of mathematics as a language for the natural sciences is quite modern. Many mathematicians some hundred years ago studied philosophy and mathematics, and often theology and law. The latter for the better perspective to earn a living. They are still closely related when it comes to logic and set theory. And philosophers like Russell, Popper, Wittgenstein were travellers between the subjects - some more and some less.
I think it is harder to separate the two as to answer: both.
The foundation of modern science includes observation and experimentation expressed in mathematics. Philosophy provides a discourse of ideas connecting past and present knowledge.