I know that noble manor-houses and castles would be built by large teams of professional architects and carpenters and other people like that, but what about the houses of rural peasant villages? Would it be more common for a peasant to hire a professional carpenter to build him a house, or would it be more likely that the whole village would pitch in to build each others houses, with every villager having some basic knowledge of construction?
There's a great answer here from u/bobbleheader which will give you some insight into the more general question of housing in the time. "Houses" as we think of them now were a luxurious thing to own. By most definitions once a peasant moved from this life into a house in a town they had the means to do so and became a burgher (townsperson), linked in etymology to the term "bourgoisie" noted in that linked answer.
It was far more likely for peasants to live in very basic stone enclosures with covered with a type of thatching or clay/mud/dung tiles strengthened with straw. These would be built around a central hearth that would convect smoke up through the roof (keeping it sealed with tars and free of bugs), a technology that can be traced back through millenia.
It's extremely unlikely that a peasant would have either the cash means or the stock-in-trade to purchase guild work for building (or any other service), they would build their dwelling themselves with help from others. The traditions of building these houses were well-established, communities would know the art very well. Also well-established was the form of usage - not only would they and their family live in that dwelling, it would also be occupied by any animals that they owned and very possibly by other families too.
Sometimes a basic barn dwelling would be provided by a landowner - usually for the well-being and security of livestock with the human overseer coming second in consideration. In these cases some assistance might be given in collecting the basic building materials such as stone, rush, clay, perhaps even lime. Otherwise it would be up to the "builder" and their community to amass these resources. From their the buidling of these dwellings would, as you suggest, often be a community effort. As was the case with many rural undertakings like ploughing, planting, harvesting, hefting and pest clearance, anybody who could move under their own power would be called in to help, whatever their age.
Sources:
Early Medieval Settlements, Hamerow H, 2004
The Urban Reformation in the Holy Roman Empire, Hamm B, 1995
Tracking the Neolithic House in Europe, Hoffman D, 2013
The Medieval Houses of Kent, Pearson S, 1994