How you reference the poem will depend on where you have sourced it from (e.g., webpage, book).
The in-text citation of a published poem should include Shakespeare's surname, the year the source was published, the original publication date and the sonnet number (if applicable).
Shakespeare, 1609/2018, XV).
Reference list:
Shakespeare, W. (2018). Shakespeare's sonnets. First Avenue Editions. (Original work published 1625).