Okay, you print the box line by line. On the first line your i variable will contain the value 0 which after the test will print an *. When you move to the next line i has the value 1, so unless j has the value 0 or width a space will be printed, otherwise an * will be printed.
The i variable handles the vertical lines while the j variable handles everything horizontally.
Code:
If i has the value 0 or 5, print an *. If j has the value 0 or 8, print an *. Anything else print a space.
i = 0, j = 1 - 8
********
i = 1, j = 1 - 8
* *
i = 2, j = 1 - 8
* *
i = 3, j = 1 - 8
* *
i = 4, j = 1 - 8
* *
i = 5, j = 1 - 8
********
Another way to view it would be with line numbers
Line 0: 012345678
Line 1: 0 8
Line 2: 0 8
Line 3: 0 8
Line 4: 0 8
Line 5: 012345678
-Prelude