Does something necessarily need to have the empirical formula CH2O to be a carbohydrate? Or is anything with only C, H, and O substituents considered a carbohydrate?
In general, yes, but as with any hard and fast rule in biology there are exceptions. Basically, it is safer to assume that you need the CH20 empirical formula for carbohydrates and then address exceptions as they come than the reverse, otherwise organic chemistry would be a lot more carb heavy.