I am confused between “Sie sind der Kellner” and “Sie sind den Kellner”. Isn’t Kellner the object here? I believe it should be the latter but I have seen the first sentence as the correct one. Can someone please explain, why is “Sie” not the subject?
This is what is called "Gleichsetzungsnominativ" or "Subjektprädikativum" in German Grammar. Sentences of the form
Subject is a Object
have the "object" (or rather, Prädikativ) in fact in nominative. German grammars actually consider what is marked as "object" above not an object, but rather part of the predicate. Look up copular sentence in English, that uses the same concept.
"Sie" actually is the subject in your sentence, and "der Kellner" must be nominative - accusative would be wrong.
Think of a question directed at the waiter:
Who are you? I am the waiter.
And now ask the person who is with you:
Who is this? This is the waiter.
See the pattern? The same is true in German:
Wer sind Sie? Ich bin der Kellner.
Wer ist das? Das ist der Kellner.
And also for this sentence:
Sie sind der Kellner.
The pattern is always:
Subject ist someone/something
And someone/something is considered part of the predicate.
This is called "Gleichsetzungsnominativ".
"Sie" is the subject and "der Kellner" is the object (you can ask for it like this: "Was sind Sie?" - "der Kellner").
"Den Kellner" would be correct if you e.g. call for them ("Sie rufen den Kellner" - Akkusativ). "Sein" here demands Nominativ and as a side note: If two words/ constructions refere to the same thing and the sentence does not contain a relationship ar an action that demands another "Fall" (or when in doupt), they usually have the same "Fall". Since "Sie" and "Kellner" refere to the same thing and there is no verb or preposition that demands another "Fall", they both are Nominativ. This also is the case for names and sometimes comes in handy here especially in more complicated sentences. "X, der da so grinst, nennt man auch 'den Glücklichen', weil er wirklich immer grinst." In this sentence, "X" can be "den" or "Luke". In any case, they are both Akkusativ. On the other hand, for "Y, der da so grinst, heißt auch 'der Glückliche'", "Luke" and "Der" are Nominativ.
"Sie sind der Kellner” is not using the article, but the determiner: I am that boy, more often translated as dieser. Compare "Ich bin heute Ihr Kellner". The correct question would be "welcher" or "wessen", respectively. We also find Ich bin der Gesellschaft Kemlner; Der Kellner der Gesellschaft (which does not command inflection in the female gender, so compare Ich bin des Hauses erster Mann, der erste Mann*). Definite articles developed after determiners.
Otherwise it is just "Ich bin Kellner". Professions are per language rules not taking an article. A profession is thus an attribute like adjectives, "Ich bin stumm".
We may say "Ich bin ein Kellner", one of many. Maybe the -n somewhat saves your intuition about the correct particle.
Also, it is ich rasier mir ... den Bart, to which the correct question is just "Was", which is oblique. Likewise Ich gebe den Kellner (i.e. act the role of). Again, you shouly ask Was achen Sie? and welchen Kellner?.
At best you could, theoretically, find Ich bin den' Kellner, short for dative denen, "to them", which is a largely obsolete construction.
I am not sure where akkusative den came from. In Greek for example, I believe, ton would be used in the specific sentence, indeed.