Assuming you're not a virgin:
ending 1: after taking the green can & coming back from the wasp room, then in the main room, walk off the platform where the trolley/elevator thing used to be. Regardless of whether you fought the boss or not.
ending 2: LOSE to the boss.
Defeating the boss has no extra benefit.
In case you got the game over ending with the two green people in the side hallway, that doesn't count as clearing the game.