Why and how did Shakespeare use the sonnet form?
There is more than one form of the sonnet. Shakespeare popularized the English sonnet. It has three quatrains (four-line stanzas) and a rhymed couplet (two-line stanza) at the end. The rhyme scheme is fairly easy: abab, cdcd, efef, gg. The fourteen lines are written in iambic pentameter, a type of meter in which each line has ten syllables and the stress alternates between unstressed and stressed syllables.
This type of sonnet develops an idea in the first twelve lines. The final lines complete the poem, providing a conclusion, a reversal, or perhaps a deepening of the poem's theme.
Why Shakespeare chose this form is a more difficult question to answer because he didn't reveal in notes or letters what his intentions were. Sonnets, in various forms, were already an established style when he began writing his. Shakespeare scholars are divided in their theories, but one idea that is common to read about is that the poems are meant to be read together as a cycle, with many of them addressed to a single person.