Students and scholars who are not considered tax residents for tax purposes are exempt from paying Social Security and Medicare taxes. (This exemption does not apply to J-2s with work authorization).
Sprintax can help you claim your Social Security and Medicare Taxes in case you had them withheld. You can check more in this topic (What is FICA - Section - Common Step 3 Questions)- https://sprintaxhelp.zendesk.com/hc/en-us/articles/8213690836893-What-is-FICA-