It is vacuum but still, a small amount of gases is found. Through gravitational pull, planets and other astronomical bodies, suck out most of the gas and particles in outer space. Hydrogen and Helium are two of the dominant gases found in space.
While hydrogen and helium make up most of the gases in interstellar space, tiny traces of other elements such as carbon, oxygen and iron also exist. Scientists who study interstellar space use spectrometers to identify trace amounts of other molecules between the stars.