the general rule of thumb for 5e, to explain it really short hand, is 'meets it beats it'; if you're using Passives, AC, or DC's, those are target numbers to meet=beat. 5e has very rare contested roll scenarios. Even in a situation where someone is Actively Perceiving (using their Action to do the Skill Check), I personally hold onto the stealth checks made as a DC in the opposite direction.
The way I handle it is thus;
Passive perception 12
Roll stealth: 16 - I am sneaking past this person, until I do something to cause them to become wary or alerted.
They roll Perception 'actively'; aiming to 'meet or beat' my 16 stealth.
Some GMs like to do a 'contested' roll, which is less used in 5e than other systems or editions, where 'ah, they're looking for you now, REroll stealth' and they roll the perception. I prefer my way because it keeps the 'DC's clean and clear, and doesn't get messy with 'who wins ties in a contested roll'. Most MONSTERS who do things like Grapple, Restrain, etc, have a DC associated with it rather than the semi-awkward contested roll mechanic used by PLAYERS when they grapple.
The way I handle it is thus;
Passive perception 12
Roll stealth: 16 - I am sneaking past this person, until I do something to cause them to become wary or alerted.
They roll Perception 'actively'; aiming to 'meet or beat' my 16 stealth.
Some GMs like to do a 'contested' roll, which is less used in 5e than other systems or editions, where 'ah, they're looking for you now, REroll stealth' and they roll the perception. I prefer my way because it keeps the 'DC's clean and clear, and doesn't get messy with 'who wins ties in a contested roll'. Most MONSTERS who do things like Grapple, Restrain, etc, have a DC associated with it rather than the semi-awkward contested roll mechanic used by PLAYERS when they grapple.