If you are new to SQL, maybe you should let this lie for a year or so. This certainly falls under the advanced category.
A general comment: a pivoting operation is a presentational device and it is a non-relational operation. That is, relational databases are not designed primarily to perform this sort of operation. Least of all if you want columns to be dynamic.
In many cases, it is better to perform the pivoting operation in the presentation layer. As I said, it is a presentational device. And there are good pivoting capabilities in Excel. Not that I have used them extensively, but I know they are there. Actually, I think you can use the Get Data option to run your query, and will take you to the PowerPivot component.
If you still want to do this in SQL, I would recommend that you compose an example with CREATE TABLE for your table(s) and INSERT statements with sample data and you illustrate the desired result from that data. This makes it easy to copy and paste into a query window to develop a tested query. We cannot copy from images.