There are some IRS rules that you can check out here.
Please read through the following from the Instructions for Form 2553 which is the S-Corp filing form.
The key factor is you must be a US resident and have a US SSN.
Who May Elect?
A corporation or other entity eligible to elect to be treated as a corporation may elect to be an S corporation only if it meets all the following tests.
It is (a) a domestic corporation, or (b) a domestic entity eligible to elect to be treated as a corporation, that timely files Form 2553 and meets all the other tests listed below. If Form 2553 isn’t timely filed, see Relief for Late Elections, later.
It has no more than 100 shareholders. You can treat an individual and his or her spouse (and their estates) as one shareholder for this test. You can also treat all members of a family (as defined in section 1361(c)(1)(B)) and their estates as one shareholder for this test. For additional situations in which certain entities will be treated as members of a family, see Regulations section 1.1361-1(e)(3)(ii). All others are treated as separate shareholders. For details, see section 1361(c)(1).
Its only shareholders are individuals, estates, exempt organizations described in section 401(a) or 501(c)(3), or certain trusts described in section 1361(c)(2)(A). For information about the section 1361(d)(2) election to be a qualified subchapter S trust (QSST), see the instructions for Part III. For information about the section 1361(e)(3) election to be an electing small business trust (ESBT), see Regulations section 1.1361-1(m). For guidance on how to convert a QSST to an ESBT, see Regulations section 1.1361-1(j)(12). If these elections weren’t timely made, see Rev. Proc. 2013-30, 2013-36 I.R.B. 173, available at IRS.gov/irb/2013-36_IRB#RP-2013-30.
It has no nonresident alien shareholders (other than as potential current beneficiaries of an ESBT).
It has only one class of stock (disregarding differences in voting rights). Generally, a corporation is treated as having only one class of stock if all outstanding shares of the corporation's stock confer identical rights to distribution and liquidation proceeds. See Regulations section 1.1361-1(l) for details.
It isn’t one of the following ineligible corporations.
A bank or thrift institution that uses the reserve method of accounting for bad debts under section 585.
An insurance company subject to tax under subchapter L of the Code.
A domestic international sales corporation (DISC) or former DISC.
It has or will adopt or change to one of the following tax years.
A tax year ending December 31.
A natural business year.
An ownership tax year.
A tax year elected under section 444. For details on making a section 444 election or requesting a natural business, ownership, or other business purpose tax year, see the instructions for Part II.
A 52-53-week tax year ending with reference to a year listed above.
Any other tax year (including a 52-53-week tax year) for which the corporation (entity) establishes a business purpose.
Each shareholder consents as explained in the instructions for column K.
See sections 1361, 1362, and 1378, and their related regulations for additional information on the above tests.
A parent S corporation can elect to treat an eligible wholly owned subsidiary as a qualified subchapter S subsidiary. If the election is made, the subsidiary's assets, liabilities, and items of income, deduction, and credit generally are treated as those of the parent. For details, see Form 8869, Qualified Subchapter S Subsidiary Election.