What you show appears to be table view, not list view.
List View, with a sub summary layout part would appear to be the better option, but you need a field where all records of the same group have the same value so that sorting can be used to arrange the records into groups with a level sub header displayed in a sub summary layout part.
Thus a Task Field would have a value, ideally a serial number value that identifies all records for the same task. And then you need a Level field with a value that identifies all records of the same Level.
Sort you records by task, then by level and you'll get records grouped by taks and sub-grouped by level. Sub Summary layout parts can be used to show a sub header for each task and with in that task, a second sub summary layout part can show the levels within that task.