Complex sentence: He taught both Yui and Nakagomi, he and Nakagomi were working on a new OS system which was about to be finished when Nakagomi stole the data and sold it.
Split into simpler sentences: He taught both Yui and Nakagomi, he and Nakagomi were working on a new OS system. When it was almost finished Nakagomi stole the data and sold it.