Whatever be the type of aircraft, each component of the aircraft that is exposed to the airflow is designed in such a way that the performance is optimized, that is, drag is minimised while the purpose the component is designed to serve, is served. The same fundamental goes into the design of the fuselage. The fuselage is that major component of the aircraft that carries passengers and/or equipments and the crew. It also acts as a medium to structurally support the aerodynamically active components of the aircraft: the wings, the vertical stabilizer and the horizontal stabilizer. In piston-propeller single engine aircrafts, and most combat aircrafts the fuselage also houses the engine and its auxiliary components.
What must always be remembered is that, before the wings, the nose region of the fuselage faces the flow. Only after the flow passes through the frontal region of the fuselage, the flow reaches the area where the wings and the fuselage are joined. So the main concern during the design of the fuselage is to minimize the flow separation in the nose region, so that the wing-fuselage joints and thus the inboard region of the wings encounter a streamline flow.
The fuselage drag is determined by the diameter of the fuselage (lower the diameter, lower the drag), the length of the fuselage, shape of the nose region (blunt rounded or sharp bullet shaped nose is preferred). The fuselage does not contribute to the lift but only to the drag. So an aerodynamically inefficient fuselage increase the thrust required to propel the aircraft to counter the increased drag.
But reducing the drag is not always the only motive behind the fuselage design. Its purpose as a payload carrier must also be optimized. For example, the Boeing 747 has a bump on the front fuselage to accommodate passengers in two levels of seating. Airbus A380 has an elongated fuselage cross-section (much like an oval) to allow for more number of passengers, higher baggage and more luxuries and amenities.
Stability considerations determine the length of the fuselage by the following principle. The stability of the aircraft depends on the balance of moments about the centre of gravity. Lift and drag are only forces. When they act at certain distance from the CG the moments are generated. The magnitude and direction of the moments required determine the distance between the main plane or wings and the horizontal and vertical stabilizers and thus the length of the fuselage.
NOTE: In supersonic aircrafts, the fuselage is designed using the Area Rule . This lends the fuselage of supersonic fighter aircrafts (especially those designed after 1950s) its characteristic coke-bottle shape. This made the cross sectional area distribution smooth and reduced the peak drag at Mach 1.