Include dependencies (predecessors and/or successors) inside subtasks, and also the earliest and latest dates of the subtasks should define the timeline of the grouped task.