After much debate, the Yard's betting pool on whether/when John and Sherlock are dating ends up having some ridiculously precise wording, like "the winning date is the day they verbally acknowledge they're boyfriends" or something similar. Sherlock finds out. He and John then do pretty much everything EXCEPT whatever the "official" proof is - they come out of the maintenance closet together looking all rumpled and Sherlock claims he was "fixing John's hair", etc. Then on the date Lestrade picked, Sherlock finally says the magic words or whatnot so Lestrade wins. It turns out Sherlock helped him pick the date and they're splitting the winnings, just like Sherlock suggested John have done with Mycroft's offer in the very first episode.
Sherlock and John throw the betting pool