Mostly in addition to what @jcaron writes, here in [Germany], the employer definitively does not "own" the employee 100 % of the the time.
But there are certain legal defaults (default meaning that the employment contract can deviate in favor of the employee, but not to the advantage of the employer) that assign IP rights to the employer regardless of whether the IP was created during working hours, and also regardless on whether you do that on a private computer/paper/email/whatever. So in that sense, an employee can be employee of their employer 100 % of the time.
This affects code (copyright) but also e.g. inventions. The argument behind this is that if an engineer is paid to solve some problem (i.e., to invent) and they get the breakthrough idea during sleep, the IP rights should go to the employer regardless of working hours - after all, such inventions are what the engineer is paid for. One may argue that creative processes are not switched on or off when checking out of the office.
IMHO the default rules are particularly unfavorable for code (maybe there have been more and harder legal battles fought already over inventions), and they boil down to the employer automatically holding the copyright in any code the employee writes that could potentially be of interest for them (for inventions they only have a preemptive right). And this of course includes the right to license this code open source or not.
No IMHO, this is not a particularly good default, and it creates all kinds of foreseeable trouble. E.g. it also applies to part-time employees, regardless of how few hours their contract covers, and any employee running a side business needs to be very careful in this respect.
At the same time, employees have a right to get permission for a side job under many circumstances - and the legal defaults can collide there.
You can negotiate for a contract that assigns only IP rights to the employer for work that is done during office hours, though.