I think I always knew. It was never any big secret, nor did my parents have a talk with me about it. I grew up on a countryside and had an interest in biology.
So I always knew how reproduction worked biologically. And how it worked with different kinds of animals. I watched mating rituals of birds, mammals, frogs, although I always had the most interest in the invertebrates.
However, the social side of it, and how humans have it for enjoyement didn't really interest me before I was 18 or so.
We did have sex ed in school, where we were taught how to masturbate (when we were 14 or so), and what different kinds of sexual practises there were (and how one should respond to them), but I wasn't particularly interested in it back then.
We had had human biology in elementary school as well, and the parts and function of the reproductive organs, but it didn't really go into the techical aspects of sex.