These kinds of homework work best when you get yourself some graph paper and a pencil and draw what you want your final shape to look like.
Then draw a vertical line along the left side of the object so that you can count empty squares and see how to write the loops to make things work.
The trick is that you aren't just printing asterisks... you are also printing spaces.
When you can count both spaces and asterisks you can see the relationship between them and the loop counter.