Complex sentence: He spent his early days in the ecclesiastical seminary in St. Petersburg, where he later became a professor of mathematics and physics.
Split into simpler sentences: He spent his early days in the ecclesiastical seminary in St. Petersburg. There he became a professor of mathematics and physics.