You need to ensure that the value in advanced filter Field Range is set to include the rows below your header rows.
You can set this value manually or use a macro to do it for you.
EG in my spreadsheet, I have rows 1-3 as multi line headers. I constantly add rows of data below. The following macro sets the Filter Field Range to include rows 4 - to the last populated row on the spreadsheet. This ensures that any sort will treat row 3 as the header (provided you check the 'my data includes headers' checkbox)
(I incorporate this at the end of a more complex macro, to ensure that the Field Range property is always up to date after data imports - easier than remembering to manually re-set it each time)
' find last row containing data in column A (column A will always be populated in this dataset)
Set WS = Worksheets("AESummary")
Set LastCellC = .Cells(.Rows.Count, "A").End(xlUp)
LastCellRowNumber = Application.WorksheetFunction.Max(LastCellC.Row) + 1
' set the filter Field Range value to include Row 4 to the last populated row in the worksheet
Rows("4:" & LastCellRowNumber).AdvancedFilter Action:=xlFilterInPlace, Unique:=False