Summarize:

You don't have to be dating someone to give them a good, warm hug. However, with guys you aren't romantically involved with, you generally need to give him a little heads up. Make eye contact, smile, and open your arms up. Unless he firmly sticks his hand out for a shake or seems to shy away/avoid eye contact, just move into the hug. Be flexible -- if he doesn't seem to want a hug, don't hug him. If he does, or you're unsure, just be yourself and do whatever you want. Very few guys will complain about a casual hug. You'll end up close enough that you can comfortably get your arms around each other and touch chests. In general, your feet will be 6-8" away from each other, but don't worry about it too much. It is a casual hug, so just be casual about it. Unless you're pressing your entire body into his and pulling him in close, you're not going to send the wrong signal. Open your arms as wide as you feel. You can feel free to open your arms wide if you want a big hug. If he doesn't seem like he wants a hug, you could give him a side hug. Move so you are side by side with him, and put your arm around his shoulder. This one-armed hug can get you out of many awkward moments if need be. Just make sure your head is going the opposite way of his head and you'll be fine. If you're the taller one, let him slide his arms under yours. This isn't a hard and fast rule, of course, but in general it is easier to slide into a hug if you don't have to reach down to get under someone's armpits. Once your arms are positioned in response to his, move them all the way around his body and gently but firmly embrace. Keep your body relaxed while you are putting your arms around his body. Your hands can be open and touch his back or shoulders, or you can clasp your own hands behind him. Don't think about yourself too much while hugging. This can make you feel awkward. Instead, concentrate on the guy you are hugging and try to enjoy the moment. Just laugh if anything goes wrong or feels awkward. Hugs are not complex signals or mating rituals -- they're a pleasant way to greet someone. Don't overthink it! To embrace warmly, try to think about him and not yourself, enjoy the moment, and give him a firm but gentle squeeze. A good way to think about your timing, if you're extra worried, is to just exhale into the hug, relaxing your muscles as you do, then stepping back gently once you're done. This will give you a good 2-3 second hug. Ease gently out of the hug and step back -- he'll do the same thing 99% of the time. You want to be outside his personal space, but don't move so far back that it seems unnatural -- one or two smalls steps is fine. Looking at him again will cement the good vibes from your hug so that you both leave the hug feeling great.
Make eye contact and open your arms before moving in. Open your arms and take steps toward him. Slide your arms under his if he's taller than you. Wrap your arms all the way around his back. Embrace him warmly and briefly. Step away, re-establish eye contact and smile again.