The regional court in the western city of Cologne said in a statement that the defendant was found guilty of plotting "a serious act of violence threatening state security".
The teenager, who was not identified by the court, was arrested at an asylum shelter in Cologne in September and went on trial in February.
Police had said the suspect's mobile phone showed he had been in touch with an IS contact abroad and expressed willingness to carry out a bombing.
However the court found that the plot was thwarted at a "very early stage". "At no time was the public specifically in danger," it said.
More From This Section
The teenager and his family were among the nearly 900,000 migrants and refugees who arrived in Germany in 2015, a record influx that has fuelled security concerns.
The suspect was brought to police attention after residents and employees at the refugee shelter where he was staying voiced concerns that he had been radicalised, as did a local mosque.
Germany has been on high alert since a series of attacks last year claimed by IS, the deadliest of which was a truck rampage through a Berlin Christmas market which killed 12 people in December.