Both are correct. Understanding the meaning is important because faith is belief in the heart and expression upon the tongue and action upon the limbs.
First one: I testify that there is no God but Allah. And I testify that Muhammed(ﷺ) is the messenger of Allah.
Second one: I testify that there is no God but Allah. And I testify that Muhammed(ﷺ) is his(Allah) slave and his(Allah) messenger.
Umar ibn al-Khattab reported: We were sitting with the Messenger of
Allah, peace and blessings be upon him, one day when a man appeared
with very white clothes and very black hair. There were no signs of
travel on him and we did not recognize him. He sat down in front of
the Prophet and rested his knees by his knees and placed his hands on
his thighs. The man said, “O Muhammad, tell me about Islam.” The
Prophet said, “Islam is to testify there is no God but Allah and
Muhammad is the Messenger of Allah, to establish prayer, to give
charity, to fast the month of Ramadan, and to perform pilgrimage to
the House if a way is possible.” The man said, “You have spoken
truthfully.” We were surprised that he asked him and said he was
truthful. He said, “Tell me about faith.” The Prophet said, “Faith is
to believe in Allah, His angels, his Books, His Messengers, the Last
Day, and to believe in providence, its good and its evil.” The man
said, “You have spoken truthfully. Tell me about excellence.” The
Prophet said, “Excellence is to worship Allah as if you see Him, for
if you do not see Him, He surely sees you.” The man said, “Tell me
about the final hour.” The Prophet said, “The one asked does not know
more than the one asking.” The man said, “Tell me about its signs.”
The Prophet said, “The slave girl will give birth to her mistress and
you will see barefoot, naked, and dependent shepherds compete in the
construction of tall buildings.” Then, the man returned and I
remained. The Prophet said to me, “O Umar, do you know who he was?” I
said, “Allah and his messenger know best.” The Prophet said, “Verily,
he was Gabriel who came to teach you your religion.” Source: Ṣaḥīḥ
Muslim 8