Lotta possebilities. Has it ever run right since you have owned it? Have you recently changed anything? When it idles, is the idle speed around 650 and is it nice and smooth? Is it fully warm when it dies? I would first look at the possebility the ignition is advanced too far. You say it shuts off when you put it in gear, have you checked to see that you still have power to the coil after it dies to rule out the possebility that the shift action itself is not cutting off power to the coil. Be sure you have no vacuum leaks, unhooked hoses etc.