Here is some information that would help
Similarity
One of the ideas Jefferson took from Locke's Two Treaties of Government dealt with unalienable rights. Locke wrote about life, liberty, and other rights that citizens were born with and that could not be taken away by any government. Jefferson used a very similar idea when he stated that all men are created equal and born with rights such as "Life, liberty, and the pursuit of happiness."
Difference
One of the biggest differences between the two writings was the target. In this case, Thomas Jefferson was using his writing to justify America's decision to become an independent nation free from British control. This was not Locke's aim, as this book was written decades before a revolution in American was even considered.