Create Custom script from bitcoind
You cannot. Bitcoin Core cannot reason about arbitrary scripts and does not have the capability to sign for them. As such, it cannot create arbitrary scripts and store them.

You can create the script yourself and import it into a wallet using importmulti. This will only add the script to the wallet to be tracked. This will only let your wallet see transactions and compute a balance. Again, Bitcoin Core cannot sign for arbitrary scripts, it does not know how to. So importing a script does not mean that the wallet will be able to sign transactions that use that script. It is purely for transaction tracking.