Most likely Portrait Orientation Lock is turned on.
This article explains what it is and how to turn it off.
If your screen won’t rotate, it could be because Portrait Orientation Lock is turned on.

image credit: Cultura/Chad Springer/Getty Images
If you see that icon, the rotation lock is turned on.
The icon at the far left, thelock and arrowicon.
is highlighted to indicate that it’s turned on.

Tap thelock and arrow iconto turn off the rotation lock.
A message at the top of the screen will readPortraitOrientation Lock: Off.
When you’re done, kill the Control Center, and you’ll be back to your home screen.

image credit: Cultura/Chad Springer/Getty Images
With that done, try rotating your iPhone again.
The screen should auto rotate when you change the position of the unit.
If it doesn’t, move on to the next steps.
On older versions of the iOS, rotation lock is found in the Fast App Switcher.
Open that by double-clicking theHome buttonand then swiping left to right.
This should clear out any bugs.
The phone will restart in the new zoom setting and the home screen will be able to rotate.
For one, the home screen on all iPad models can rotate.
For another, the setting is controlled a bit differently on some models.
Not every app supports automatic screen rotation.
Don’t expect the screen to rotate if you’re using an app that doesn’t support that feature.
FAQ
fire up the picture you want to rotate in the Photos app, and then selectEdit.
Choose theCrop/Rotateicon at the bottom of the screen.
Use theOrientation Lockoption in the Control Center to toggle auto-rotation on or off.