All design is an exercise in compromise. Some relevant considerations in a global sense relate to -
(a) undercarriage weight and cost
(b) for larger aircraft, cabin clear height, as the carry through structure is more easily buried in the lower fuselage which has the depth there anyway for tanks and holds.
(c) operational environment which plays a big role in considering engine location.