On F1/OPT you are exempt from residency for 5-years. Income not subject to FICA taxes. Must file nonresident tax return. Do not get standard deduction; you get itemized deduction. You get extra deduction as per tax treaty.
On H1-B, your presence in the U.S. count toward substantial presence test (SPT). Must pay FICA taxes. If you qualify for resident tax return, you get standard deduction or can opt for itemized deduction.
Read
Your U.S. Tax Return: The U.S. Visas