Formm 8823 asks for several questions to determine your tax status. Generally if you have been in the US for less than 5 years, you can claim you are a non-resident alien for tax purposes. You don't have to pay social security and medicare tax.
In your case you may be able to claim non-resident alien status for last year, but not for this year since you have filed AOS.
In your case you may be able to claim non-resident alien status for last year, but not for this year since you have filed AOS.