If we want to fly our aircraft for years to come without disturbing our neighbors with the noise coming from our engines we need to take measures to silence the exhaust. In some countries its required by law and they classify the aircraft in noise categories which are coupled to the landing fees. The less noise your aircraft emits the less you pay.
A basic exhaust system should be able to carry the heat and gases away from the engine without creating a fire hazard or leaking poisonous gases (CO or Carbon Monoxide) into the cockpit/cabin. It also should be easy to maintain and repair if necessary.
But one can not bolt a pipe to the engine and be done with it. Even the exhaust is bound by rules based on safety reasoning helping to make sure that the gases are properly routed away from the cabin and do not create a fire hazard.
There are a number of rules developed concerning aircraft exhaust systems and FAA FAR 23.1123 says that:
(a) Each exhaust system must be fireproof and corrosion-resistant, and must have means to prevent failure due to expansion by operating temperatures.
(b) Each exhaust system must be supported to withstand the vibration and inertia loads to which it may be subjected in operation.
(c) Parts of the system connected to components between which relative motion could exist must have means for flexibility.
Although this is not mandatory for experimental aircraft, it shows wisdom that you do follow to these rules. As already said: its all about safety.
If you build your own exhaust then you need to take some things into consideration while doing so. Not in any particular order, these are listed below:
As you can imagine, hot exhaust gases need to kept away from other parts inside the engine cowling. When installing a new exhaust or your own design you might need to cut and weld to fit it. Or you may need to modify the cowling so that it is well clear of the hot pipes.
Vintage aircraft sometimes have these short stacks on each side of the engine as 'exhaust'. Which is perfect for these old timers. They do are easy to maintain and inspect, have no back pressure and keep the exhaust valves cool. But a major drawback is that they are not really quiet. Which is nowadays not the way to go for every day use aircraft.
With a manifold all the separate stacks joins together in one tailpipe and the engine is much, much quieter. One can build a tailpipe on each side of the engine. Some radial engines, notably the Rotec, have a beautiful exhaust system where each cylinder stack is connected to a collector ring and this gives the engine its great radial sound from the good old and these days.
To reduce back pressure the exhaust is ported into the tailpipe in the correct firing order. This can increase the engine RPM by 100, thus giving more power and greater fuel economy. Crossing these stacks can be a real challenge under the cowling of some aircraft models.
As the engine will not sit still in its mount, you need to use ball and slip joints to account for any movement of the exhaust pipes. All taken together, the cross-over system is more complex.
As the exhaust runs through the tailpipe it pushes any air (or exhaust gases form other cylinders) in it outward. Thus the pressure rises. If this tailpipe pressure becomes higher than ambient pressure the engine must 'push' the exhaust against it and this costs power. This then can not be used to drive the propeller.
Some engine types (two stroke gasoline engines) need back pressure to operate, but we need to make sure that any exhaust pipe is large enough and that no sharp bends are present in the system to keep the pressure as low as possible.
Exhaust gases need to be expelled by the engine with ease. The exhaust needs also to clear the aircraft fuselage so that the gases are exhausted to the rear utilizing any energy that is left as a form of jet exhaust. You might need to insulate certain parts under the fuselage to protect them from the heat.
Make sure that the propeller slipstream, which flows around the fuselage, doesn't push the exhaust back into the cabin through any rear air vent, intake or window.