There is no exact definition of "organic" compound, although you can say that organic compounds must contain carbon.
There is no requirement that organic compounds can be found in living things, although the name organic comes from the fact that the first compounds in this class that were discovered did come from living things. That said, $\ce{CO2}$ is in living things - all metabolic processes either consume or produce $\ce{CO2}$ (with the exception of some thermophiles).
In general, ionic and "simple" molecular compounds that contain carbon are not called "organic," partly for historical reasons, but also partly because the category "organic" is more than just a name - it describes an entire set of bond types, reaction patterns, naming rules, and structure types. This is why there is no exact, simple definition - it is hard to draw a boundary around all of that and say "these other things don't belong."
Taking your example, $\ce{CO2}$ is not normally called "organic," even though it contains carbon, it is produced and consumed in biochemical reactions, it has similar properties to other organic molecules, and organic bonding principles can describe it. The reason for this is probably because historically, $\ce{CO2}$ was discovered and named before organic chemistry existed as a field.
Some people say that in order to make it easy, any carbon-containing covalent compound is "organic" (your teacher is probably in this group). Some people say "any compound containing carbon and hydrogen" should be the rule. Both of these rules have exceptions, though, so they can't be used as exact definitions.