A stoppie can be done by fully applying the front brake while leaning forward on the bike. To be able to do it for 2 seconds, you'll need to get up to a high speed before slamming the front brake (and the front brake only, so make sure your brake settings allow for that).
Races with long straight sections are best for this.