When a program is loaded to memory, but its pages are not loaded all at once (but only on demand) is called Demand Paging. That is, only when the program needs the data/code on a specific page, this page will be copied from disk to memory.
We call the mechanism behind such paging a lazy pager (or lazy swapper.)
To tell what pages are currently loaded to memory and which ones aren't, we add another column to the page table called the invalid bit. If a page is loaded onto a main memory frame, the bit will be 1 (valid); if it isn't loaded, the bit will be 0 (invalid). The OS will use this column to learn which pages are present in memory at the current moment (= memory resident pages).
In case a program needs to use a page that is not currently in memory, a page fault trap (= software interrupt) will happen. To handle this interrupt, the OS will copy the content of the missing page from disk to memory.