In AEM Forms Designer, you have the master page that governs the orientation.
In your case, apparently you need 2 master pages. 1 which is portrait and other which is landscape.
Both the master pages will have a content area defined in them, which refers to the region within which content can be placed.
Let's say C1 is the content area for portrait master page and C2 is for landscape master page.
Then go to your actual content pages/subforms and review their pagination menu.
Make sure that your first four pages are placed in content area C1, while 5th page is placed in content area C2.