Start with a drawn layout of the room(s) you want to install the carpet, get an exact measurement of the rooms, closets included, both length and width, and add 3 inches all around for variants in the walls. (Plus you have to have room for the stretching, trimming and tucking under the baseboards.) If you take your layout to the place you're buying your carpet they will be able to give you more details, just make sure you let them know you've added the three inches to each side of the room so they don't over sell you.
Sorry not real sure 😞
Thanks! Your answer is awaiting moderation.