Question: I am not a native English speaker, but I am interested in learning a certain grammar rule. I did come across many sentences where the subject and the verb switched their positions.

For example, I can say that I don't like apples nor does my friend. Here, the modal verb `does` comes before the subject `my friend`.

Another example: not only is he a great person, but he is humble.

What is this rule and when is it appropriate to use it?

Answer: 
English has quite a strong tendency to have the verb second in the sentence (not necessarily the second word, but the second constituent) Normally the subject is the first constituent that precedes it; but there are a number of other items which may serve that function, and in those cases the subject moves after the verb:

* Emphatic negatives:

> 
> Never shall I see him again.
> 
> 
> Neither could they reach it that day.
> 
> 
> At no time did I notice this.
> 
> 
> 

* Other adverbs with negative polarity:

> 
> Rarely did they come and visit.
> 
> 
> Hardly had I arrived than he spoke.
> 
> 
> 

These are mostly a bit literary, but as you point out "neither/nor does ... " is normal in speech.
There is an archaic mode of speech where the subject can come after the verb in the interrogative, as in this excerpt from John Bunyan's ["The Pilgrim's Progress"](https://books.google.com/books?id=wPliAAAAcAAJ&pg=PA95-IA1&lpg=PA95-IA1&dq=the%20pilgrim%27s%20progress%20see%20you%20yon%20tree&source=bl&ots=RZ_pWpf2KR&sig=c54AceTye0WpJX92r9VldKO8zdo&hl=en&sa=X&ved=0ahUKEwix2cykw-jRAhVEilQKHb5xDJgQ6AEIGjAA#v=onepage&q=the%20pilgrim%27s%20progress%20see%20you%20yon%20tree&f=false) (1678)

> 
> **See you yon tree?** 'twill well our purpose suit;  
> 
> ' Let us go near; its leaves are full and fair,  
> 
> ' It stands a type of false profession there
> 
> 
> 

The similar archaic imperative (command form) puts the subject after the verb, as in the [King James Bible, Matthew 4:10](http://biblehub.com/kjv/matthew/4-10.htm)

> 
> Then saith Jesus unto him, **Get thee hence**, Satan: for it is written, Thou shalt worship the Lord thy God, and him only shalt thou serve.
> 
> 
> 

[**Update**] I forgot about the standard question form of the "to be" verb:

> 
> Are you going to work today?
> 
> 
> Are we not men?!
> 
> 
> Is he or is he not the President?
> 
> 
> 

Note that I interpret the question as asking where the subject can come after the *entire* verb, and not just between the auxiliary verb and the principal verb.