O People of the Book! Do not exaggerate in your religion, nor utter
anything concerning God save the truth. Verily the Messiah, Jesus son
of Mary, was only a messenger of God, and His Word, which He
committed to Mary, and a Spirit from Him. So believe in God and His
messengers, and say not “Three.” Refrain! It is better for you. God is
only one God; Glory be to Him that He should have a child. Unto Him
belongs whatsoever is in the heavens and whatsoever is on the earth,
and God suffices as a Guardian.
The Study Quran, 4:171, p. 620
As we can see with the Ayah above, Jesus is the son of Mary and was only a messenger of god. In regards to what it means by "Word" and "Spirit" here, Jesus was created by Allah’s Word “Be!” and he was, and life was breathed into Jesus by the holy spirit (the angel Gabriel) at the command of Allah. 1
In-depth explanation of "Spirit" or "Ruh"
There are multiple interpretations of "Spirit" (Ruh) in Islamic Scholarship. One of the most common opinions is that life was breathed into Jesus by the holy spirit (the angel Gabriel) at the command of Allah. Others include that "Spirit" could be a figurative word for Jesus's purity or God's Mercy.
and Mary, the daughter of ʿImrān, who preserved her chastity.
Then We breathed therein of Our Spirit, and she confirmed the Words
of her Lord and His Books; and she was among the devoutly obedient.
The Study Quran, 66:12, p. 3184
We can see that in Quran 66:12, builds up a strong backing that "Spirit" here means that life was breathed into Jesus by the holy spirit (the angel Gabriel) at the command of Allah since it is literally stated "Then We breathed therein of Our Spirit" in the ayah.
Other interpretations include:
The miracle of Jesus’ virgin birth is also alluded to here in that he is
identified as God’s Word committed to Mary (alqāhā ilā Maryam), which could
also be rendered “cast upon Mary.” Cf. 66:12, where it is said that God breathed
His Spirit into Mary. Consistent with the implicit representation in 66:12 of Jesus
as God’s “Spirit” breathed into Mary, in the present verse Jesus is also identified
as a Spirit from God. Cf. 2:87, 253; 5:110, where Jesus is strengthened . . . with
the Holy Spirit. It is on this basis that Jesus is given the honorific title of “Spirit
of God” (Rūḥ Allāh) in the Islamic tradition. Some commentators, however,
understand Jesus’ description as a Spirit from God metaphorically and consider
Spirit here to be either a reference to Jesus’ purity or a metaphor for God’s
Mercy (raḥmah; R).
The Study Quran Commentary for 4:171, p. 620-622
Extra Source to check out: Jesus as a Word and Spirit from Allah