To export a layered PDF from Revit, you have to use AutoCAD as an intermediary tool. Here's how to export a Revit sheet to PDF with layers:
1.Export the Revit sheet/view to DWG file format.
2.Open the DWG file with AutoCAD.
3.Click Ctrl + P and select "DWG To PDF.pc3" printer.
4.Click "PDF Options" and make sure the "Include layer information" checkbox is ticked.
5.Customize the other options as you like, such as plot style, scale, sheet size, etc.
6.Click "Preview" to preview the output and then tap "Print".