In film-making, some people consider a copy of an action scene scene-by-scene to be a homage. Is it any different in literature; how do you distinguish the two of them? If, for example, we take the final scene in Romeo and Juliet, and decide to let a scene play out in the exact same way, but reword everything so that it's not in the same format and is not using the same words, is it considered to be plagiarism or a homage?
Standard "I am not a lawyer" here...
Plagiarism is an act where you take something of someone else's and pass it off as yours.
An Homage is where you take what exists and do it in your own style, unique to you but still reminiscent of the original.
The difference is in how you write it. Find the most important parts to the scene and write around that. It's like how this famous scene has been paid homage to in dozens of other works. The important beats are 1) nonchalantly doing something such as conversing, playing guitar, or on a stroll (also could be talking like in the original), 2) be interrupted by someone who isn't paying attention, and 3) yelling at them "Hey, I'm X-in' here!" where X could be "walk-", "talk-", etc.
For example, by having your character shredding some sick riffs on their electric axe, you could have another person accidentally trip over the speaker's cord unplugging it prompting the guitarist to yell, "HEY! I'm rockin' here!" This would be an homage because you're clearly pulling an inspiration from the scene without repeating it as if it were your own.
But what if you had your character talking with somebody about the types of women who would hire a male prostitute or while trying to sell management services? What if they did this while walking down a busy street? Let's say he almost gets hit by a car/cab and as a result shouts this out at the driver? That becomes plagiarism.
Plagiarism is about the degree of similarity. You can be inspired by the scene, but you need to be able to point to many of the things that makes your scene different from the source. I recommend 3 major differences or 7 minor differences EXCLUDING your characters. Unfortunately, though, there is no hard-and-fast rule guaranteeing protection from being sued for infringement. The best you can do is have a solid case prepared for if it happens in order to show the judge that your scene was not infringing on the original nor the rights of the original's owners.
(I am not a lawyer. Nothing I said should be seen as legal advice. I recommend passing your writing through a copyright attorney before publishing, or at least talking to a professional, before acting upon advice from a rando on the internet.)
And other people consider it a cheap remake (Psycho, I am looking at you!)
If you take a particular scene, for example the scene in R&J where Romeo is with the apparently dead Juliette and you change almost everything he says and does, that is not plagiarism. You are inspired by a great scene and taking it in a different direction. Unless done with love and exquisite care, it could be sacrilege, but it would not be illegal.
West Side Story is a fine retelling of R&J.
What we read will naturally colour what we write. It will influence our diction, the direction our plots take and the tone of our work. I have read much over the years and sometimes find myself yearning to create just such a perfectly shining phrase that it lingers in the memory.
If one were to try and write like the Bard did and on the subjects he treated it would likely fall flat and seem unnatural. We write as we write and the pressure to dumb things down so that anyone can read our works is rather pernicious.
Write what you want to write, your own characters doing what seems natural to them. It has been told before - all stories have - we just take what came before and make it our own, make it come to life.
I would love to write something like War & Peace, but that is not what is in me - I think. I have written high fantasy and now am working on my thriller. Its inspiration was rather odd - a thought crossed my mind and I grabbed it.
Write something original and something that is uniquely yours.