Muslims believe the Prophet did not commit major sins (Qur'an 53:2-3), but there's a difference of opinion about minor sins, e.g.:
- "...he never committed a sin, major or minor, ever", MuftiSays.com
"...Prophets are free of major sins, but not of minor sins", Islam Q&A
A common line of thought is: the Qur'an commands us to obey the Prophets (e.g. Qur'an 4:59; 4:64) and not to follow sinners (Qur'an 76:24), so it's illogical that the Prophets would be sinners.
The Prophet is recorded as asking for Allah's forgiveness:
By Allah! I ask for forgiveness from Allah and turn to Him in repentance more than seventy times a day. -- Sahih al-Bukhari 6307 (sunnah.com)
Muslims believe he conveyed the Qur'an accurately (Qur'an 15:9; Tafsir al-Jalalayn) which is one of the six articles of faith.
However, he had limited knowledge, and is referred to as the "unlettered Prophet" in Qur'an 7:157, typical interpreted as meaning he was illiterate. The Prophet is recorded as making mistakes in irreligious matters, e.g. Sahih Muslim 2363 (sunnah.com) refers to some poor advice given by the Prophet about the grafting the trees; AskImam.org describes granting freedom to the captives of the battle of Badr as an "error in judgment".
As for if he were capable of committing sins or just chose not to sin (and if this only applied to certain sins), there's differences of opinion; I'll avoid opening that can of worms and just refer to: The Infallibility of the Prophets in the Qur'an, Sayyid Muhammad Rizvi (which is available from at Al Islam) who writes
Although the majority of Muslims believe in the 'ismah of the prophets, there is a great difference about the extent of their 'ismah. ... As far as the Sunnis are concerned, they have a great difference of opinion among themselves.