There are a few popular ways.
Have a duplicate game board with a referee to validate things.
Have a map of the game board set aside with the secret locations marked.
Have numbered locations on the board where the hidden units can be and mark the number down secretly.
Use decoy markers.
Place
several markers on the board and treat them like a real unit.
Only one of the decoy markers represents the actual unit.
boardgames.stackexchange.com/users/2733/CaulynDarr
In Stratego, you don't know which units are which, but I am sure that isn't what you mean.
Scotland Yard and Clue: The Great Museum Caper have a player record their moves secretly, and only reveal their location at the end of the game.
Battleship does it with independent boards.
You could also institute a Fog of War by placing unit tiles facedown among blank tiles.
Moving unit tiles on your turn (only you know the location of your units) when your opponent isn't in the room.
When you maneuver a unit adjacent to another you flip the tile and reveal an opponent’s unit or a blank.
At the end of your turn, you replace the blanks and your opponent returns to the room and takes their turn.
boardgames.stackexchange.com/users/1873/user1873
The Ravensburger game Pyramid has a fairly creative solution to this problem: The board is stood vertically, with all the pieces attached by magnets to respective sides.
All but one of the players sit on one side and move their pieces to collect treasure inside a pyramid.
The other player is a mummy and is trying to capture them, but he only knows where they are when they reveal treasure.
In practice, the mummy sits on the other side.
Additionally, there is a mummy magnet on the adventurers' side as well, so that when the mummy moves, the other players can see where he moves to, making the mummy's location known to all, but the adventurers' locations secret to the mummy.
Not a particularly deep game, but one I really like just for this creative approach to secret piece movement!
boardgames.stackexchange.com/users/1678/Johno
ASL has two levels of secrecy: the simpler is concealment , where you place a blank counter (actually marked '?')
on top of every stack, and have a few stacks consisting only of blanks; when the other player 'would see' the stack (it moves in the open, is successfully fired at, etc.)
, you take the blank (or blanks) off.
Hidden requires you to write down a hex number for each hidden unit, with any relevant information (equipment, facing...).
When you want that unit to act, you have to put it on the board (possibly concealed).
It is also possible to have one board for each player, with a barrier between them.
On your board you place your own units and your guess as to the enemy dispositions.
A neutral referee checks each move (ideally having his own board, which will be right for both sides), and reports what is visible.
boardgames.stackexchange.com/users/1644/Tim Lymington
Some game resolve this with having your units as cards, with a monogenous backside.
The player will have a stack of cards with units on them, ranging from strong to weak.
He also have a stack of blank decoy cards, and when he places the cards on the battlemap, only he knows which contains units and which are blanks.
With this method, you can also make some sneaky bluffs with the number of cards you put in each stack, which order you place them in and so forth.
boardgames.stackexchange.com/users/1536/Nils Munch
One idea for keeping secret units, well, secret on a shared board would be for the player controlling said units to maintain a notepad with current (and past) unit locations.
Keeping track would be trivial on a grid-based board where you could note "Spy is moving from A-2 to B-4".
This could be even simpler if combined with some variety of rules-enforcing system like a small computer application, a game master, or even a numbered turn counter to add to the notes.
boardgames.stackexchange.com/users/2953/Hyppy
The simplest way is for units which cannot move while hidden.
They can simply start off hidden with a counter one every location.
When you want to activate a hidden unit, turn over one of the counters.
If people can search a location for hidden units, then let them look at a counter and discard/replace it.
Alternatively you can merely write down where they are and reveal them whenever you want.
Written approaches lack the transparency of the counter method though, since you could easily cheat or forget a unit is in a location where it should have been revealed.
If you want to move hidden units, you could swap two neighbouring location counters.
This will give clues to the other players where units might be moving, however.
You could possibly allow more then one move at a time so some might be real and some fake.
This approach has the advantage that you cannot accidentally lose track of your hidden unit, and forget they should have been killed/revealed.
boardgames.stackexchange.com/users/2933/Nick
One way to place units at a hidden location that has not yet been mentioned is in MB's Gamemaster series Shogun , later renamed Samurai Swords due to naming conflicts.
There players hold a card for each province they control.
When they hire ronin (mercenaries they only get for one turn) they place the card(s) of the province(s) where they want to put the ronin facedown and put the ronin pieces onto the back of the card.
Thus the other players can see how they are spread (like 3 different provinces each reinforced with 2 ronin or all 6 in a single province)
but unless that province is attacked or the ronin should be moved (picked up by a regular army)
they can only guess where exactly the ronin are.
boardgames.stackexchange.com/users/24865/Volker Landgraf
I've heard that there are games where the units on the board are secret -- that the other player doesn't know where they are.  How does this actually work?  How can you have units on the board without the other players knowing their location?
How can you have units with secret locations on the board?
boardgames.stackexchange.com
<game-design>
boardgames.stackexchange.com/questions/7492
boardgames.stackexchange.com/users/1888/Joe
Scotland Yard and Clue have a player record their moves secretly. ASL also has two levels of secrecy. Scotland Yard and Clue: The Great Museum Caper have a player record their moves secretly, and only reveal their location at the end of the game.  ASL has two levels of secrecy. The Ravensburger game  Pyramid  has a vertical board with all the pieces attached by magnets to respective sides.  One idea for keeping secret units on a shared board would be for the player controlling these units to maintain a notepad with unit locations.
Scotland Yard and Clue: The Great Museum Caper have a player record their moves secretly, and only reveal their location at the end of the game.  ASL has two levels of secrecy. The Ravensburger game  Pyramid  has a vertical board with all the pieces attached by magnets to respective sides.   One idea for keeping secret units on a shared board would be for the player controlling these units to maintain a notepad with unit locations.