1560s, "engage (the attention of) beforehand, engross in advance of or to the exclusion of other things," from pre- "before" + occupy. Sense of "occupy before others" is attested from 1620s. Related: Preoccupied; preoccupying.
word-forming element meaning "before," from Old French pre- and Medieval Latin pre-, both from Latin prae (adverb and preposition) "before in time or place," from PIE *peri- (source also of Oscan prai, Umbrian pre, Sanskrit pare "thereupon," Greek parai "at," Gaulish are- "at, before," Lithuanian prie "at," Old Church Slavonic pri "at," Gothic faura, Old English fore "before"), extended form of root *per- (1) "forward," hence "beyond, in front of, before."
The Latin word was active in forming verbs. Also see prae-. Sometimes in Middle English muddled with words in pro- or per-.
mid-14c., occupien, "to take possession of and retain or keep," also "to take up space or room or time; employ (someone)," irregularly borrowed from Old French ocuper, occuper "occupy (a person or place), hold, seize" (13c.) or directly from Latin occupare "take over, seize, take into possession, possess, occupy," from ob "over" (see ob-) + intensive form of capere "to grasp, seize," from PIE root *kap- "to grasp."
The final syllable of the English word is difficult to explain, but it is as old as the record; perhaps it is from a modification made in Anglo-French. During 16c.-17c. the word was a common euphemism for "have sexual intercourse with" (a sense attested from early 15c.), which caused it to fall from polite usage.
"A captaine? Gods light these villaines wil make the word as odious as the word occupy, which was an excellent good worde before it was il sorted." [Doll Tearsheet in "2 Henry IV"]
During the same time occupant could mean "prostitute." Related: Occupied; occupying.