Hi @Lylyy
If you want to pivot multiple columns, then it is suggested that you use case when along with aggregate function instead of PIVOT.
Here is a doc for your reference: T-SQL: Dynamic Pivot on Multiple Columns.
Also, see this blog: Dynamic PIVOT on multiple columns.
Best regards, Cosmog Hong