Dogs have knees and elbows, two of each—just like humans. The knees are located at the back legs (also called hind legs), and the elbows are located at the front legs (also called forelegs).
In fact, all four-legged animals have two knees at their back legs and two elbows at their front legs. There is a common misconception that elephants are the only animal with four knees, but it is a myth.
It might seem like dogs have their knee backward, but that is just a hock joint (which is basically an ankle).
Humans walk on their hocks, but dogs do not. Dogs, as well as cats and horses, actually walk on their toes.