He definitely didn’t sin. The Bible states that “he was like us in every way, except sin”.
Could he have sinned? No. Why? Because the Person of Jesus was God. He was one person (the second Person of the Trinity) with two natures (human and divine). And the human soul of Jesus (which was part of his human nature) possessed the beatific vision of God from the moment of conception. There is no way that the Person of Jesus (Who is God) could have disobeyed God, and there is no way that the human soul in possession of the beatific vision could have acted contrary to the will of God.
So, my answer is: Not only did Jesus not sin, but he could not have sinned.
And I would support this statement with the following quote from Pope Leo XIII:
Pope Leo XIII: “Thus it is that the infinitely perfect God, although supremely free, because of the supremacy of His intellect and of His essential goodness, nevertheless cannot choose evil; neither can the angels and saints, who enjoy the beatific vision. St. Augustine and others urged most admirably against the Pelagians that, if the possibility of deflection from good belonged to the essence or perfection of liberty, then God, Jesus Christ, and the angels and saints, who have not this power, would have no liberty at all, or would have less liberty than man has in his state of pilgrimage and imperfection”.
Notice he says that Jesus Christ does not have the power to sin.