Put this together as there are always many questions on how to protect your demense on succession, and how to ensure your favorite heir gets the titles. I will caveat by saying this is probably ahistoric and a little bit of an “advantageous” use of existing systems, but for those who want a more stable playthrough, this should help.
The idea is to construct a de jure primary title that consists of just your county titles with feudal elective, and then additional title(s) of the same tier as your primary that follow normal inheritance rules. You can then specify your primary heir to inherit all your important counties, while the other territories get distributed. This works best starting as a count/duke, but it can loosely be applied to any ruler.
Select 3+ duchies that you wish to use as your core counties to pass down the generations. Ideally, this is 3-4 duchies that contain 8-15 counties total as you want to be holding the majority of titles in this land.
Start as a count or duke within this area and systematically conquer the land you identified in the previous step. If not, let the multi-dukedom split apart and reconquer it. It may take a generation or two depending on your faith’s ability to generate prestige quickly.
Create a custom Kingdom holding the counties you selected in Step 1. DO NOT conquer more land before creating the custom Kingdom as you only want to create a Kingdom with the territory you identified earlier.
Quickly go to war to capture an additional Kingdom title. If you don’t think you will be able to create a kingdom and conquer one in the same lifetime, don’t create a Kingdom at all and let the duchies split so you can reclaim them.
With a created Kingdom title and a conquered/usurped/inherited one, select your primary/custom Kingdom and add Feudal Elective to it. To guarantee your desired heir, you should have no more than 1 de jure vassal in the custom Kingdom. You can make do with more, but then just make sure you land Dynasty members in your de jure Kingdom so you maintain ownership of the lands in the event of a vote gone bad.
Select your desired heir in the Feudal Elective vote and Profit! If you conquer and hold additional land outside of your core demense, it will be distributed among other heirs on succession. Although, you should generally be at max holding capacity with just your core lands, so a more likely scenario is distributing lands to your unlanded, non-heir children as soon as it is conquered. The dynasty grows and everyone is happy, and it seems historically realistic as well.
Bonus tip of this set up is that it allows you to cycle up and down your primary title tier throughout a long playthrough. Getting tired of being a king or emperor? Simply conquer a duchy in a far flung area and set up your desired heir to inherit it with Feudal Elective. Then, land a non-Dynasty member in your old core territory and vote for them to inherit your primary title. You will then be demoted to playing as a duke on succession, since a non-Dynasty member inherits your primary title. Simply declare independence from your old lands and you can start rebuilding as a duke somewhere else.
In order to really make it nice, give most of your core lands in your old territory to a Dynasty member and only county to your non-Dynasty election candidate. On succession, you can claim your independence, and then you can watch from afar as your Dynasty rebels against the non-Dynasty ruler and reclaims the lands for your House. This ends up being an effective way to grow your Dynasty’s footprint from the outside in.