That is a very open ended question, and might be better answered in the tech/ops forum. In any case, aircraft have a minimum number of pilots. Most today need 2 pilots. Then you have to consider duty-hour laws of the countries the airlines fly out of as well as the collective agreements with the unions. So beyond a certain number of hours, there will be a third pilot on board. There could also be a check pilot on board if it is either a training flight or a regular line check on other pilots. There could also be pilots on board, but not actually working, who are positioning to another airport to either take over that aircraft or another aircraft and fly from there.
So as you can see, the number of pilots is determined by quite a few factors.
"it's kind of like an Airbus, it's an engineering marvel, but there's no sense of passion" -- J. Clarkson re: Coxster