Set Orientation can be downloaded from Google Play - see the download link at the end of this article. After you install it and open it, the app will show a drop-down menu that lets you choose between different screen orientation modes. If you want your screen to always rotate according to the way you're holding your device, you have to choose "Automatic (full)", then tap OK. This way, Instagram and any other portrait-only or landscape-only app will rotate according to your device's position. Set Orientation can also make your screen always display everything in portrait or landscape mode.
After opening Set Orientation, you'll notice that the app will stay in your status bar, always being just a swipe away. You can get rid of it by choosing "Disabled" from the app's drop-down menu (this will also re-enable your device's default screen orientation settings). If you want to change your screen orientation habits again, you'll have to re-open the Set Orientation app.
How to force landscape or portrait mode (Android)
2. Once you open the app, you can tap on this drop-down menu to choose between different screen orientation modes.
source: Google Play