Pete, you need to keep the camera at one orientation for the duration of recording a video. The phone may insert coding into the video file regards to which way is "top" at start of the recording. It doesn't change the coding during the recording so flipping it during a recording makes the picture go sideways.
Holding the phone/camera vertical is called "portrait" orientation, gives a taller picture, which is suitable for example taking a picture of a seated person ... a portrait photograph.
Holding it horizontal is known as "landscape" orientation, provides a wider picture which usually is better for washer videos.