Break it down in small pieces.

draw_rectangle(x, y)
- draw ul corner
- draw top line
- draw ur corner
- for loop
- draw left side
- draw right side
- draw bl corner
- draw bottom line
- draw br corner

Think about where the cursor is, and where it has to be, and how to get it there. Your options are printing solid characters, printing spaces, and printing newlines.