The correct placement of a rug mostly depends on the size of the room and what furniture configuration you have. The most important thing to aim for is balance.
If you have two sofas then the rug needs to be equally positioned between them symetrically. In a small space, the rug should sit in front of a sofa, so there is a narrow strip of floor showing, making the room appear more spacious.
In a big open space, a big rug should sit under at least the front legs of the sofas, but ideally a very big rug can have all the furniture on it to center the space. This placement creates a cozy area without shutting it off to the rest of the room.
Whether a living room or dining area, a rug is the best tool to create zones in an open space. If you’re zoning the dining area, make sure to choose a rug that’s big enough for all the chairs to sit entirely on top.