Prerequisites :
-You have to update to lateast Android firmware "
marshmallow "
-you have to download
Google now launcher .
How to rotate your screen :
Make sure you have auto-rotate flipped on in the Accessibility section and in the Google Now Launcher if you’re using that on your home screen.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.
Source : rooter15 , greenbot