Spelling isn't grammar. Neither is punctuation, really. Those are mechanics.
Grammar refers commonly to the structure of language (which is actually frequently changing because, well, language changes), and how they relate. So typically it's stuff like syntax and morphology, and sometimes semantics and phonology.
So things like SVO, OVS, SOV, VOS, and VSO (Subject, Verb, Object and its variations), and what sounds come together to create singular meanings, is grammar.