This is a common Toyota 4Y issue; unit cranks and starts but as soon as you release the key the engine stops. At the distributor there are two wires in the connector. One is 12VDC with the key on, the other is "tach sense". When this problem occurs the tach sense wire is usually broken in the harness or in the connector.
This is ONLY to be used to report flooding, spam, advertising and problematic (harassing, abusive or crude) posts.