I was looking at his wikipedia page and on the styles section it mentioned him being the duke of Schleswig-holstein and I was wondering how a Russian monarch was a duke of a German province.
In short, Nicholas II had matrilineal ties (on the mother's side) to Schleswig-Holstein. But don't let the title fool you - it didn't give Nicholas II any power over the Danish-German duchy.
These ties date back to when the eldest daughter of Russian Emperor Peter the Great (b.1672 - d.1725), Anna Petrovna, married Charles Frederick I, Duke of Schleswig-Holstein-Gottorp (another name for the duchies in modern day Germany and Denmark.)
Now, when Anna's sister Elisabeth seized power in Russia in a coup, she was unmarried. To obtain an heir, Elisabeth roped in her nephew, Anna's son, the somewhat unwilling Karl Peter Ulrich, who would briefly become Peter III of Russia before being deposed by his German-born wife, Catherine, better known as Catherine the Great. (As a further tie to Schleswig-Holstein, Catherine the Great's mother was born Joanna Elisabeth of Holstein-Gottorp).
And on an interesting side note, Peter III and his ducal ties ran deep: as Peter III sought to invade Denmark to recover the territory of Schleswig for his native Duchy of Holstein, land lost some decades earlier! Other than for Peter III's personal pride, it is apparent that conquering Denmark would do nothing for Russia. In the event, Peter III was deposed by Catherine before the invasion could begin. The reader may perhaps infer that it's generally better to focus on reigning over one state than two.
However, while the ducal title wouldn't pass to a woman, it would pass to Paul I, Catherine's despised son. And from Paul I, to all the other future Romanov monarchs, ending with Nicholas II. Technically, while known as the Romanovs, these monarchs were in fact from the House of Holstein-Gottorp-Romanov. However, future Romanovs didn't appear to take their ducal ties too seriously - which is not surprising considering the relative size of a small hemmed-in Danish-German province when compared to the constantly expanding Russian Empire.
However, as with his predecessors, Nicholas II's title was honourary - he wouldn't have had anything other than a ceremonial role in the running of Schleswig-Holstein, which by Nicholas II's reign anyway was a province of Prussia under Nicholas's frenemy and cousin Wilhelm II, the last Prussian (and German) Emperor.