He had some lucky breaks for sure.
Dan Quayle targeting him, out of all the rappers with violent lyrics he could have picked, helped him out.
The role in 'Juice' helped him start portraying an image that was more marketable than his previous socio-political image that had more in common with Public Enemy et al.
The fact that he had the opportunity to join Death Row, who's notoriety matched his was a big PR boost.
The first shooting, whilst it was a very fucked up thing to happen, did wonders for his PR.
Same for 50 Cent, he played that situation to his advantage even though 50 wasn't even very famous when he was shot.
Of course, the murder made him an instant legend, not unlike many popular musicians who die young (Kurt, Jimi, Jim Morrison, Ian Curtis, Bob Marley)