Declare independence war (If you arrange so you hold most counties and your liege only one then you should be able to easily beat him).Die or abdicate and continue playing as a count under duke who was former vassal count.Change succession law to elective and vote for our vassal as your successor.Grant a city to your dynasty member, then grant him a coastal county and then duchy (this will make him independent).Create 2 duchy titles but don't create kingdom or empire.If you are feudal ruler and are vassal to a doge who is part of your dynasty then after he inherits your title you will play as merchant republic.
If it still doesn't find one then the title goes to the liege. Normally merchant republic holders and heirs can't inherit feudal titles or vice versa but there is one exception: If one does not have any eligible heir then game by default uses primogeniture to find one.