The Prophet ﷺ said: If one enters a horse with two others when he is not certain that it cannot be beaten, it is not gambling; but when one enters a horse with two others when he is certain it cannot be beaten, it is gambling. (Using translation from Abū Dāʾūd 2579)
عَنِ النَّبِيِّ ﷺ قَالَ مَنْ أَدْخَلَ فَرَسًا بَيْنَ فَرَسَيْنِ وَقَدْ أَمِنَ أَنْ يَسْبِقَ فَهُوَ قِمَارٌ وَمَنْ أَدْخَلَ فَرَسًا بَيْنَ فَرَسَيْنِ وَهُوَ لَا يَأْمَنُ أَنْ يَسْبِقَ فَلَيْسَ بِقِمَارٍ