The Prophet ﷺ said, "Whoever manumits a slave owned by two masters, should manumit him completely (not partially) if he is rich after having its price evaluated."
عَنِ النَّبِيِّ ﷺ قَالَ مَنْ أَعْتَقَ عَبْدًا بَيْنَ اثْنَيْنِ فَإِنْ كَانَ مُوسِرًا قُوِّمَ عَلَيْهِ ثُمَّ يُعْتَقُ