Single line of dialogue with a dialogue tag and an action first.
Leaning in closer, she said, “He is leaving.”
Dialogue interrupted by a dialogue tag.
Dialogue can be interrupted by a dialogue tag and/or action and then resumed in the same sentence. The commas go inside the first set of quotation marks and after the dialogue tag and/or action.
“He is leaving,” she said, “to get Ann’s gift.”
“He is leaving,” she said, leaning in closer, “to get Ann’s gift.”
Questions or exclamations in dialogue without a dialogue tag.
Question marks and exclamation marks are contained within the quotation marks. When a dialogue tag is used, it isn’t capitalized as it is part of the sentence.
“He is leaving?” OR “He is leaving?” she asked.
“He is leaving!” OR “He is leaving!” she cried.