Change "focus switch" behaviour in OS X Yosemite
macOS is an application-centric model (by most recently used), whilst Windows uses a window-centric model (by z-order).

Read more: https://www.isotoma.com/blog/2010/05/10/solving-the-real-alt-tab-problem/

You can use a number of third-party apps to make macOS use a window-centric model, see the answers to this question for some examples.