Depends on the size and weight (and value) of the rug. The traditional method was to sew a muslin or heavy cotton tube of fabric to the top edge of the rug, forming a sleeve, and slip an appropriate size dowel rod through the tube. Hang the rod on wall mounted brackets. For small and/or light rugs, you could use velcro, with one side sewn onto the back of the rug and the other attached to the wall. There are also special felt lined clips that can be used. The aim is to avoid small hang points that dont fully support the weight of the piece and that can result in sagging or even tearing of the fabric. This is similar to the recommendations for hanging any fabric art, such as prize quilts. There is a danger using nails or tacks directly through the fabric which tears the fabric fibers and can also stain over time.
My experience is from many years of doing quilt shows, but I believe the procedures for safely hanging valuable rugs is the same.