Requirements to become a CPA

Hey guys, Hope everyone is doing well. I have a question regarding the requirements to become a CPA. So what I heard is you need to pass the exam and have 2 years of experience? Do you need to work directly under a CPA for it to count? I am in PA btw. Let me know if you guys know the answer or know where I can find the answer