Kreshnik Berisha, 20, born near the business capital Frankfurt to a family from Kosovo, was found guilty of membership in a foreign terrorist organisation, said presiding judge Thomas Lagebier.
Berisha had admitted in court to having joined IS and taken part in fighting in Syria.
The prosecution had called for a sentence of four years and three months, while the defence had urged a lesser term of three years and three months.
He returned home for unclear reasons in December 2013 and was arrested at Frankfurt airport.
The trial opened in September.
Germany's domestic intelligence service believes about 550 German nationals have joined the IS in Syria and Iraq, 60 have died there in combat or suicide attacks, and 180 have returned to Germany.