Dogs have two elbows and two knees; to have a knee you need a kneecap, and only their back legs have knee caps. The only animal with four knees is the elephant.
It ends at the elbow. The elbow is the first joint in the dog's leg located just below the chest on the back of the foreleg. Sometimes called the carpals, pasterns are equivalent to the bones in your hands and feet —not counting fingers and toes — and dogs have them in both forelegs and hind legs.