but in case i need to leave the house for few hours i don't want him to cry/bark or most importantly get anxious.
Like other posters, I would strongly advise against doing this and strongly encourage you to crate the puppy inside. In the scenario you've described, barking and/or anxiety is really low on the list of Things That Could Go Wrong
. For example, the puppy could get entangled in the line and injure or strangle itself (#1 reason why I hate tie outs). The puppy also could eat something potentially dangerous (e.g., sticks, rocks, even poison) which could lead obstruction, mouth/throat puncture or internal bleeding, resulting in a trip to the ER --- if you're lucky. If a puppy/dog is going to be outside, you need to provide shelter from the elements to which puppies are uniquely susceptible (heat, rain and cold) with clean water continuously available. Puppies are notoriously good at knocking over water buckets and playing. Would you want to leave it alone for several hours, in high temps, and risk dehydration? Finally, it's not uncommon for unsupervised dogs to be stolen from their yards and used for nefarious purposes (e.g., resale, bait dogs, etc.) or because an unbalanced person simply wants that cute puppy.
Another thing to consider is that puppies want to be with you
. Their desire/impulse for proximity is critical in establishing a solid relationship and beginning training. Don't let such an important opportunity pass you by.
I've found crate training and/or x-pens (inside!) to be a great tool for teaching dogs/puppies all sorts of useful things (e.g., how to behave when left alone). Most importantly, you know that the puppy is a safe as you can make it when you're not there. Lots of links here describing how to do this, so rummage around.