As we observe in commercial aircraft, that there are four or two front end nozzles for gas emission in the air.
What is the reason for this variable of 4 or 2 nozzles? Why is it not a constant?
the "front-end nozzles" you mention are the air inlets for the plane's jet engines- one inlet per engine. The outlet that emits exhaust gases at great speed is in the rear of the engine. Some jets have only one engine, and one inlet. Some have two, some three, some four engines; the B-52 has eight engines and eight inlets.
Greater numbers of engines are used to power bigger, heavier planes. Early engines were not very powerful and so older planes that were big and heavy (B-47, B-52, 707, DC-8, 747, etc.) had many engines. Modern engines are much more powerful and so fewer of them are needed, even on big planes.