How do plants take in only carbon dioxide?
Plants don't take in only CO2, they take in whatever the atmospheric concentration of gases is: gases travel freely across membranes, so it is difficult to select for certain gases.

What your teacher is explaining is based simply on the laws of diffusion in that diffusion results in a net flow from areas of high concentration to areas of low concentration. If CO2 is being used up in chemical reactions in the leaves of a plant through photosynthesis, that means that concentration of CO2 is low there, so the net diffusion of CO2 will be from outside the plant to inside.

Calling it a rush might be a bit misleading, but in general gases mix fairly rapidly (compared to, say, liquids). The plant doesn't really have to do anything to facilitate this except to have surface area available for gas exchange.