Now punctuating dialogue is a bit tricky. First of all, you never let two characters talk in the same paragraph.
Commas and other punctuation go inside the quotes. And you must paragraph each time a new person speaks.
Finally, Everything a person says at one time (even if they change the subject) goes in the same paragraph. This is pretty simplified, and there is more in an earlier post if you need a refresher.
I can't stress too much how important it is to punctuate dialogue correctly. Editors know immediately if it's done wrong, and they also know it will take them a lot of work to fix it. It's never a good idea to make work for your editor.