When you start routing the hose, give it about an inch or two going straight up from the vent, then make your bend and route it underneath the engine or wherever.
What that does is allow the air to escape easily, but makes it difficult for the oil since gravity is working against it.
The oil spray generally condenses or sticks to the sides of the hose and drains back into the case while the air is flowing freely through the center of the hose.
It's the most basic principle of an air/oil separator.
Easiest and fastest way to do this is by making a loop in the hose and loosely zip-tie it together.
Sorry for the ugly drawing, just threw it together so you could picture it:

Ideally, the longer the length of vertical hose, the better.
The longer the path for the oil spray to travel, the less oil will actually make it out.
It works the same way with fuel tank vent lines too...if you don't think it works try riding on a full tank without that vent line and you'll see what I'm talking about LOL
Also, the end of the hose should be below the lowest point of the engine (or gas tank if you're setting up that vent line too)...reason being is that if it lands upside down, nothing will drain out because the opening is now higher than the fluid level.
You might spill a little bit of oil after you tip it over, but it's only going to be a tiny amount that managed to fill the line.