I assume you're referring to the earthquake? In that case, it's tied to beating a specific level number. By default, that level is level 18, but you can change the number through "Overworld -> Change Boss Sequence Levels" and then the "Earthquake Sequence" level.
If you just mean getting the head to emerge, that's just a series of overlaid Layer 2 event tiles. You can see the sequence as the 6x6 tiles 0x10 through 0x18.
Professional frame-by-frame time wizard. YouTube
- SMW Glitch List
- SMW Randomizer