Obviously, that code will print 3 stars on every line. You see why that is so, yes?
What you need to do is figure out the relationship between the stars printed on one line, and the stars printed on the next line. Then think of a way to capture that relationship in the logic of your inner loop.