A team formation problem consists in finding an effective group of experts in a social network to accomplish a job with a minimum expenditure of energy and time. This problem has been transposed into the domain of multiagent systems to form a team of autonomous agents whose mission is to achieve a given goal. There is a wide range of such problems. This paper generalizes one of them by assigning explicit behaviors to agents whose tasks are equipped with multiple attributes. Their values are compared with preferences attached to the desired tasks of the goal. A synthesized controller realizes the goal by invoking tasks of a subset of the available agents, called a composition in this paper. Furthermore, utility values are assigned to compositions and robustness is considered to be an important property of a team to prevent its deterioration when one or more of its agents fail. Finding a robust team that satisfies the goal's preferences with better utility values for compositions constitutes a difficult optimization problem. The proposed method to solve this problem consists in three phases: controller synthesis with filtering on tasks with respect to some qualitative preferences, composition ranking based on their fitness, and multiobjective mathematical optimization.