Deductions & credits

Thanks @DanaB27. Finally, while filing for an extension, how do I calculate the payment? Should I base it based on resident alien filing 1040 or as a nonresident alien filing 1040 NR and the claim this payment plus the actual refund?