Tupac is the greatest rapper of all time because of his impact on the genre and world. Tupac was a figure head when rap was in its height in the 90s. He rapped with importance, with songs like Dear Mama, Changes, and Brenda's Got A Baby. Not only did he play a tremendous roll in rap, he also advocated for the black community and was heavily influenced by his mother, a member of the Black Panther Party.
Jermaine Lamarr Cole is rapper, producer, and record executive. He was born on a military base in Germany and raised in Fayetteville, North Carolina, J. Cole initially gained recognition as a rapper following the release of his debut mixtape, The Come Up, in early 2007. J. Cole is my favorite current rapper because he raps with meaning and he tries to give back to his community. A good example of this is the 4 Your Eyez Only documentary on HBO. However, i dont think he is at all close to Tupac's level of fame and importance.
Kendrick Lamar has had a very similar impact as J. Cole, however it has not lasted as long. Kendrick Lamar has, arguably, more meaning behind his raps and overall projects. But, he is under J. Cole because of his longevity.
Kanye West is fourth only because of the impact he has had on music as a whole. I am personally not a fan of Kanye, but he has incredible influence in rap and more importantly producing.