I respectfully disagree with the above answer. It was economic problems at home and Nicholas insistence on ruling as an absolute monarch, not the loss of confidence by the Russian Generals, that forced Nicholas to abdicate.
Although Nicholas II was a pious and dedicated family man, he was ill equipped to rule under any circumstances, let alone a country the size of Russia with its myriad problems. One observer said of Nicholas that he:
would have been an ideal country gentleman, devoting his life to wife and children, his farms and his sport
He was traditional to the core, and believed he had a solemn duty to preserve the monarchy. This he believed, together with the Russian Orthodox Church, had secured Russia's legacy as the Third Rome.
After the 1905 revolution, Nicholas II had created a Duma (legislative assembly) for the Russian people, however Nicholas had no confidence in the Duma and instead relied on the antiquated Russian bureaucracy. He had absolute veto power over any decisions of the Duma, and exercised that power frequently. His failure to consult the Duma brought him under increasing criticism not only from members of the Duma but also from the middle class. When calls were issued for a new government more responsible to the people, Nicholas dismissed the Duma.
Next, Nicholas dismissed his War minister and travelled to the front himself to lead the war effort; he believed that his presence there would inspire the troops. Nicholas had no war experience, and this was an insane mistake. While he was at the front, his wife, Alexandra, fell under the influence of Grigori Rasputin, a self styled "holy man" who often interfered in family and political matters and caused deep resentment among the Russian people. Alexandra had a strong dislike for Parliamentary government and had long believed Nicholas should rule absolutely. While he was away and at Rasputin's urging, she attempted to do so herself; an act which further alienated the already troubled Russian people.
Economic deprivation finally took its toll, and on March 8, 1917, bread riots broke out in Petrograd (formerly St. Petersburg). The riots soon spread and Nicholas issued orders from the front that the army should restore order. Instead, soldiers broke ranks and joined the rioters. The Duma then assumed control and declared a provisional government. Nicholas knew his days were numbered, and abdicated on March 16, 1917.