X or Zero?
As X, use Rising flame during the first form just as Sigma appears, if timed right he will not get an attack off, do this two times, when he disappears, hightail it to the main top of whichever wall is closer, and stay there until he follows through with his screen slash, repeat until form two. In this form, Sigma throws his scythe in a half circle of whichever direction he's facing, run behind him and blast him, then jump on the wall for the next attack, he will throw his scythe whever you are, which is a bad thing if you're on the floor, as the attack is near impossible to dodge. If it sticks in the wall, however, you can shoot him while dashing to the wall behind where he jumps and fires those dual lasers from his eyes, blast him after the laser stops and prepare to repeat the process, once you learn the patterns and timing, you should take no damage for the first two rounds, therefore saving your energy tanks. Form three has five attack styles actually. If attacked by the red head, he homes his shots at your position when he fired, so stay put for the first two against the wall where the Blue and Yellow heads are, after two shots, scramble to the top for the next two, then drop down before they hit. The blue head is easily dodged, just jump on top of it or jump to the top of the far wall. The yellow head is the only one that should have a chance to hit you, Rising Flame it as soon as it appears to minimize attack. The Sigma head on the floor will either try to suck you in or blow you into a spike wall. Dash in opposite direction until wind stops, then hit it with Ground Hunter, it will fade after a few hits then one of the heads will attack...dodge accordingly. Laser Gun Sigma is vulnerable in the face. If he is just shooting random shots then dodge them before the spread out and try to land a few shots on him. If he says "The End" then scramble to the top of the Heads Wall to the left quickly, else you will feel pain...lots of it. Either way when this form fades you will be attacked by another one of the heads again. Repeat until finished. Both heads need to be destroyed before victory.
Zero has an easier time with this. Sigma's first form is still weak to Flaming Uppercut (Forgot the name of the attack), and same attack pattern still applies, hit him twice then climb a wall until his screen sweep is done, repeat. Form two...same. Form three, Flaming Uppercut the Laser Gun Sigma head when opportunity arises, mostly in his Non-The End attack pattern, and use Zero's Ice Attack on the Ground BOund head. Also, the Flaming Uppercut is useful on the Yellow head when it attacks! Hope this helps you!