You can file a joint US return with your spouse in case you or your spouse are deemed as a resident for tax purposes.
Please note that if you and your spouse, both are deemed as nonresidents for tax purposes in the US, you are not eligible to file a joint tax return.