Pre-ejaculatory fluid starts to seep out during sexual AROUSAL, so it comes out when he's erect. Sexual activity is not necessary to initiate the secretion of the fluid, but it will CONTINUE during sexual activity.
As I said, even though he pulled out BEFORE he ejaculated, the pre cum would have already been deposited in your vagina.
Unfortunately, "knowing" someone for years does not preclude them being infected with HIV.
It is very rare for a man not to produce SOME pre cum. One man may produce a large amount while another man may only produce a teaspoon or less.
Pre cum does NOT contain sperm so it cannot cause pregnancy by itself. However, as the purpose of this fluid is to "flush out the penis," it will bring any sperm left in the penis from the last ejaculation to the tip of the penis. If this happens, that small amount of sperm COULD cause a pregnancy.
But you have stated you are NOT pregnant.
Unless your partner is one of the incredibly few men who do not produce pre cum, then even if he pulled out before orgasm, the pre cum would have already been deposited in your vagina.
Not many studies have been conducted on pre cum, but the few well documented ones have shown MOST of the samples DID contain HIV.
Unless you and your partner are in a 100% committed and trustworthy relationship, and both of you tested negative for HIV and other STD's before you began having unprotected sex, then what you have described to us is risky sex and testing is warranted.
Both of you should have a 4th generation DUO test 28 days post your last encounter. (Any sex you engage in during that 28 days must be PROTECTED) Follow all further testing guidelines recommended by the doctor or clinic where you are tested.
We wish both of the very best
RubyWitch