I am trying to figure out how does the horizontal stab attached itself to the plane and moves up and down? Is the HS attached by the rear spar and to the fuselage?
Fighter aircraft usually have their tailplane connected to the fuselage with a single pivot joint, as visible in this F-15 drawing:
Passenger aircraft often have a horizontal tailplane which is a single part, and as such, the entire stabilizer is being trimmed by an actuator around a pivot, as can be seen in this 727 drawing. The actuating system is different on newer aircraft, but the idea is the same.
The stabilizer is hinged at the quarter-chord point of the tail surface and has a second, movable attachment point. This second point can be moved up and down, generally by turning a spindle on which a nut rides which moves the second attachment point.
A300 stabilizer root (source)
On this picture (sorry, was the best I could find now) you see the stabilizer being attached to the bulkhead ahead of the APU. Ahead of it, near the left edge of the drawing, you see the vertical spindle which moves the forward attachment point. It turns according to trim commands from the flight control computer or from the cockpit.
Apart from those listed above, some unique aircraft have the horizontal stabilizer attached solid to the vertical stabilizer and then the entire pair pivots around a point on the empennage. The Lockheed Jetstar does this (next time you look at a Jetstar, look for the silver strip of metal below the horiz. stab.) but more commonly, the Mooney M20 series uses this mechanism, illustrated below: