Deuteronomy 5:21: “You shall not covet your neighbor’s wife. You shall not set your desire on your neighbor’s house or land, his male or female servant, his ox or donkey, or anything that belongs to your neighbor.”
Why was covetousness mentioned in relation to only the neighbor and no one else, e.g, parents, siblings, relatives, friends, people we don't know etc, and how have we later extended the context to all other people? Why were the examples mentioned, and yet was added the sentence "or anything that belongs to your neighbor?"
Jesus was asked a similar question. "He said to him, "What is written in the law? What is your reading of it?" So he answered and said," 'You shall love the LORD your God with all your heart, with all your soul, with all your strength, and with all your mind,' and 'your neighbor as yourself.'" And He said to him, "You have answered rightly; do this and you will live." But he, wanting to justify himself, said to Jesus, "And who is my neighbor?"" (Luke 10:26-29). Jesus replied with the story of the good Samaritan -- the man who took care of a stranger who was beaten by robbers. ""So which of these three do you think was neighbor to him who fell among the thieves?" And he said, "He who showed mercy on him." Then Jesus said to him, "Go and do likewise."" (Luke 10:36-37).
The word "neighbor" isn't restricted to just the people who live in the house next to yours. The word literally means the person nearby and that applies to everyone you are near to. Everyone around you is your neighbor, wherever you are. That would include family, friends, and strangers on the street.
The focus of the command is on the concept of coveting, which is a way of saying greediness. Examples were given, but the point is that it coveting is not restricted to just the items listed. You can covet (have greed for) many things. It isn't what you are coveting that makes it wrong, but the greedy desire itself that is wrong.
For more, see the lesson "Thou Shalt Not."