This is paragraph formatting. First, it is important that you use display of hidden formatting marks.
Showing non-printing formatting marks in Microsoft Word
You can get to that control under the paragraph group by clicking on the dialog launcher in the bottom-right corner. Use the second tab and check "keep with next."
00 deleteme 1.png
If you use the built-in heading styles, this attribute is built in.
Why use Microsoft Word’s built-in heading styles? by Shauna Kelly