When to officially resign (after getting h1b approval) before 2 weeks notice or after 2 weeks?
So if I get an approval from the uscis I can resign and work for two weeks until I start working for the petitioner?
Yes.
Hope You realize that you have two H1Bs petitions that are both valid. One from current employer and other from future employer. Once you get the future employer's H1B approved, you resign and continue to work at current employer for 2 more weeks as a courtsey
Your official resignation email triggers the start of your two week notice.