قَالَ مَالِك : فَإِنْ كَانَتِ الضَّأْنُ هِيَ أَكْثَرَ مِنَ الْمَعْزِ وَلَمْ يَجِبْ عَلَى رَبِّهَا إِلَّا شَاةٌ وَاحِدَةٌ ، أَخَذَ الْمُصَدِّقُ تِلْكَ الشَّاةَ الَّتِي وَجَبَتْ عَلَى رَبِّ الْمَالِ مِنَ الضَّأْنِ ، وَإِنْ كَانَتِ الْمَعْزُ أَكْثَرَ مِنَ الضَّأْنِ أُخِذَ مِنْهَا ، فَإِنِ اسْتَوَى الضَّأْنُ وَالْمَعْزُ أَخَذَ الشَّاةَ مِنْ أَيَّتِهِمَا شَاءَ
So if the sheep are more and the goats are fewer, and one head of zakat is obligatory on the owner, then a sheep should be taken. And if the goats are more and the sheep are fewer, then a goat should be taken. If the sheep and goats are equal, then the zakat collector has the choice to take whichever one head he wishes from them.