Most phones are big now, so sometimes it makes sense to rotate over to landscape mode. If that’s the case, you might want the screen to move along with you, so it’s a more natural experience that matches how you’re holding the phone or tablet.
There are a couple of spots to do this with Android Marshmallow. If you have the Google Now Launcher, swipe right over to Google Now and launch the Settings.
Then touch Allow rotation to ensure that the feature is enabled. This is allow rotation of only the home screen, and only if you're using the Google launcher (other custom launchers that come with your phone may or may not have a similar function).
To allow apps to rotate the screen according to the orientation of your device, or stop them from rotating if you find them turning around while you lie in bed with your phone, go to Settings > Accessibility and turn on Auto-rotate screen. This is on by default on most phones.
You may notice a screen rotation lock button in the quick settings of your phone, too. Swipe down from the top of the screen to check.
Now when you turn your device you’ll see the app icons, search bar, and other details flip their position. It’s particularly great for larger devices like the Nexus 6P and tablets as you won’t have to turn your head anymore when you switch from portrait to landscape mode.