I was wondering what is the grammar rule to include a question as a part of a sentence? Here are some examples:
Can you tell what am I missing? vs. Can you tell me what I am missing?
Tell me what am I missing? vs. Tell me what I am missing?
Do you know why he did this? vs. Do you know why did he this?
I don't know why he did this. vs. I don't know why did he this.