He said, "Thank you." He said. "Thank you." He scratched his nose, "Thank you." He scratched his nose. "Thank you." Commas and periods. Please can you tell me, which of the above sentences are correct and why?
He said, "Thank you." He said is a dialogue tag. The example is therefore a single sentence. He scratched his nose. "Thank you." He scratched his nose is a separate sentence, not a dialogue tag. An action like this incorporated into dialogue is called a beat. He said, she said - Mechanics of Dialogue
the difference is simple: one can say 'thank you'... one can not scratch one's nose 'thank you'... and a dialog tag must always have a comma separating it from the dialog, regardless of whether it's the usual dialog-following tag, or a preceding one...