If he was an employee, but if he was paid as a 1099 and no assignment of IP agreement was signed, it is his.
Additionally, if it was a "derivative work" of code he had written prior to W-2 employment, that would also muddy the waters of IP ownership.
So they weren't contractors or employees, which makes this a giant mess to sort through.
Source: Almost 10 years ago I was in a situation that was shockingly similar to Daniel's.
Either one of us buys the other out, or we dissolve the business. He chose to buy me out and attempt to keep going, but the company folded less than a year after I left.
It wasn't quite a messy as this situation seems to be, but it was rough, as both of us had basically put everything we had into the business.
2-person startups are kind of platonic marriages, and as such splitting up is basically getting a divorce (at least in terms of mental stress).
edit: to answer your "what would I do differently" question, absolutely insist on getting a lawyer up front to draft all the paperwork and employment agreements (we didn't do this because it seemed so expensive).
As a SWE, all of my employment contracts explicitly state that code that I wrote for the company is owned by the company. Just because he was paid for services does not mean that the company owns the copyright of the code he wrote.
What jurisdiction do you work in?
I live and work in Sweden too and I am able to dictate those parts of my contract. Especially as I do a lot of open source work.
The Copyright Office has a circular that they distribute to clarify and help people decide, in general, whether certain types of work qualify as "works for hire" or not. [0]
Further complicating it, Micay says the code is licensed non-commercial. So how can the company commercially exploit that code anyway? I'd be suspicious of any after the fact employment agreement attempting to coerce a re-licensing permitting commercial usage.
The way I see it (with my limited legal knowledge, IANAL) is that Daniel Micay got paid for his services, and therefore the copyright is assigned to the company behind CopperheadOS. I'm not sure if Daniel can be fired, that'd depend on the legal entity of CopperheadOS (for example, in a general partnership both partners bear responsibility and liability which levels the playing field). I tried looking it up on the homepage, but I've been unable to figure that out. What is the legal entity behind the company "Copperhead Security"?
[1] https://en.wikipedia.org/wiki/General_partnership