In my reply specifically, you'll have to start bitcoin-qt with --datadir and other parameters.
In the command line, use the same method but start bitcoind with the same parameters but you'll also have to add different -rpcport -rpcuser -rpcpassword per instance
so that you can use bitcoin-cli RPC commands to specific nodes.
This is how I start my bitcoind Regtest 3-Nodes setup:
Node1:
bitcoind -regtest -port=8330 -datadir=E:\AppData\Bitcoin-altdir1 -rpcport=18001 -rpcuser=node1 -rpcpassword=node1
bitcoind -regtest -port=8330 -connect=127.0.0.1:8330 -datadir=E:\AppData\Bitcoin-altdir2 -rpcport=18002 -rpcuser=node2 -rpcpassword=node2
bitcoind -regtest -port=8330 -connect=127.0.0.1:8330 -datadir=E:\AppData\Bitcoin-altdir3 -rpcport=18003 -rpcuser=node3 -rpcpassword=node3
So, when using bitcoin-cli to use RPC commands, you'll have to add the specific -rpcport -rpcuser -rpcpassword to tell which node to send the command.
Example for Node1:
bitcoin-cli -rpcport=18001 -rpcuser=node1 -rpcpassword=node1 getblockchaininfo