I came to the Prophet ﷺ while he was accepting pledges of allegiance and said, "Messenger of Allah, extend your hand so I may pledge allegiance to you, and set whatever conditions you wish upon me, for you know best."He said, "I take your pledge that you will worship Allah, establish the prayer, give the zakat, be sincere toward the Muslims, and part ways with the polytheists."
أخبرني محمد بن قدامة قال حدثنا جرير عن منصور عن أبي وائل عن أبي نخيلة البجلي قال
أتيت النبي ﷺ وهو يبايع فقلت يا رسول الله ابسط يدك حتى أبايعك واشترط علي فأنت أعلم قال أبايعك على أن تعبد الله وتقيم الصلاة وتؤتي الزكاة وتناصح المسلمين وتفارق المشركين
[Its chain is sahih] It was mentioned previously before this, number 4181, and it is found in Al-Kubra, number 7800.