Revit creates shadows on the fly using the graphics card, so shadows represent what you can see on the screen.
If you hide anything in a view it will not cast a shadow. For example if you hide the roof and ceiling in a view, shadows are cast inside as if there is no roof and ceiling.
For shadows to work a few basic things have to be set up:
Where the building is located (sun angle varies with location).
Where North is.
Your view includes the whole building and not just part of it (particularly in relation to height).
There is something for shadows to fall on.
The date and time.
Below are how these can be set up in Revit.
SET LOCATION
First set the location of the project.
From Manage > Location:
Use the search to find the location of the project.
SET TRUE NORTH
Make sure True North has been set. If not follow instruction in GUIDELINES > SET TRUE NORTH
VIEW RANGE
In each view you will use for shadows make sure View Range settings means shadows will be seen in full.
Set Top primary range and Cut plane to be above the highest object that will cast a shadow (Top primary range can be set to unlimited).
Set Bottom primary range and View Depth to be below level that shadows are cast on (can be set to unlimited).
GROUND PLANE
Make sure you know where shadows will fall.
If there is not a TopOsurface, floors or pads representing the ground go to Sun Settings dialog:
Set the Ground Plane at Level: to be a level representing the ground plane.
This has to be done in each view created for showing shadows.
Note that using the Ground Plane at Level: setting assumes a dead flat ground plane (which it may not be in reality).
DATE AND TIME
Set the date and time for the shadows.
Equinox are 21 March and 21 September, Summer solstice 21 December, Winter solstice 21 June.
SHADOW INTENSITY
In the Graphic Display Options dialog:
Under Lighting adjust Shadows intensity to change how gray shadows will appear.