If your document contains custom spreads (such as a 3- or 4‑page foldout in a magazine), any master you apply should contain the same number of pages.
In the Pages panel, select the pages to which you want to apply a new master. Then press Alt (Windows) or Option (Mac OS) as you click a master.
Choose Apply Master To Pages from the Pages panel menu, select a master for Apply Master, make sure that the page ranges in the To Pages option are the ones you want, and click OK. You can apply a master to multiple pages at once. For example, you can type 5, 7‑9, 13‑16 to apply the same master to pages 5, 7‑9, and 13‑16. (See Display absolute or section numbering in the Pages panel.)