You're using the mouse and keyboard, I hope.
Hold the right mouse button when you're up against a wall or a flat surface. A or D key to peek out to your left or right when you're at the edge. W key to go over the top if you're behind a box or a fence.
You can also set the right mouse button to toggle mode if you don't want to hold it.