I am a beginner.
When unfolded, the whole thing is A3 in size.
After folding it as an accordion as shown,
And fold half along the dotted line, it is now A5 in size.
Could anyone help me by telling me how to config the setup of the document to achieve this?
Make a new lansdscape A3 document, one or two pages, as needed. On the Master Page add guides to indicate the folds. You can automate the vertical guides by giving the file a margin of 0 and making if 4 columns with a gutter of 0. I would also add a bleed and, in the bleed area, draw fold marks, which would be dotted hairlines to indicate to the bindery where the folds are.
Now build a separate 8 or 16 page file and ignore the folds or right side up orientation and build it normally. In the first file use File > Place to place the pages from the second file and position and rotate as needed.