@Gwideon The absolute most important rules when writing dialogue in fiction (iN mY oPiNiOn):
1. If the speaker changes, start a new paragraph. Always, always, always.
1.1 This also applies if the subject changes in the break in someone's monologue, even if the person taking action doesn't say anything.
2. If a character needs to monologue, break it up into multiple paragraphs by ensuring that the key, most important information, as it is being monologued, is always at the beginning or end of each; don't bury important reveals or details in the middle of a paragraph.