I was doing squats and I felt something pop and then had a sharp pain on the back right of me head, what could have happened?

Something. Dr lofti is correct. Something popped and prompted you to ask the question. The body is all connected and improper alignment in one area can affect other areas. If you have any persistent discomfort, be evaluated. Squats can really overload the lumbar spine and lead to disc issues so be sure you are doing correct form, not overloading the weights and not going til you are at muscle failure.
Nothing much!! There is not sufficient information for a diagnosis but unlikely to be due to anything serious.