Shakespeare departed from the Aristotelian model in many ways, although it’s not clear that he did so consciously. We don’t know for certain that Shakespeare ever read Aristotle's “Poetics” or was aware of its principles. His ideas about tragedy may have come more from watching his contemporaries’ plays and the mystery plays and other sorts of drama that were popular at the time, which were themselves in part indebted to Aristotle. It's entirely possible that Shakespeare just wanted to write an interesting play and was not thinking about Aristotle at all.
That said, “Hamlet” does have both elements that follow Aristotle’s principles and elements that would have set Aristotle’s teeth on edge. Aristotle believed that a tragedy should be rooted in the experience of a single protagonist (which “Hamlet” is), and that the protagonist needs to have some amount of stature, often royalty, so that when they fall over the course of the play they have a long way to fall (check). He also believed that the main character should be brought low by some tragic flaw within himself, and here “Hamlet” begins to waver from Aristotle: although Hamlet is a deeply flawed character, his tragic fate doesn’t entirely hinge on some fault within him that can be easily identified. Aristotle also believed that the tragedy should take place entirely in one location (nope) and that the action of the play should contain no jumps in time: the length of the performance is exactly the amount of time that the characters experience (“Hamlet” doesn’t do this at all, though “The Comedy of Errors” and “The Tempest” both do). In a strictly Aristotelian tragedy, there is also no room for comedy; he believed that tragedies should focus on the tragic and noble characters and that laughs and lower-class characters should be confined to comedy. Shakespeare had absolutely no interest in separating tragedy and comedy: his tragedies are full of humor; his comedies are often full of very disturbing things. The gravedigger scene in “Hamlet” is completely at odds with what Aristotle thought a tragedy should be, for instance, so while Shakespeare borrows some of Aristotle's ideas it is very clear that he was not interested in all of them and in fact the ones that he followed he may have followed purely by coincidence and not out of a conscious sense of obligation to Aristotelian ideas.