From Sahih Muslim (Hadith 3930):
Jabir (Allah be pleased with him) reported Allah's Apostle (ﷺ) forbidding selling of (produce) in advance for two years, and in the narmtion of Ibu Abd Shaiba (the words are):" Selling of the fruits (on the tree) in advance for two years
Reference: Muslim 3930