He was simply heating ammonium cyanate, which was accepted as a definitely inorganic substance, when he found crystals forming that resembled those of urea, which was the chief manmalian waste product disposed of in urine (including human urine).
Both ammonium cyanate and urea have molecules composed of the same atoms (two nitrogen, four hydrogen, a carbon, and an oxygen) but differently arranged.