You have to learn a few things, which you do along the way, but basically, poetry is a matter of the ear. Iambic pentameters or what constitutes a stanza comes naturally - your ears will know.
Vikram SethI sometimes seem to myself to wander around the world merely accumulating material for future nostalgias.
Vikram Seth