Good Day Shubh
You can use the day difference expression to determine the day difference between the current date and the date of birth, this will return a number value. This number value would then need to go through a conditional check to see if it is less than 365 (total amount of days in a year) in which case the result would be displayed in days OR if the number value is greater than equal to 365 then the result would be displayed in years.
Please see the below configuration steps in order to setup the above explained (Please see the below screenshots):
Hide contentShow content
Step 1
On the initialize rule for the viewform the Data of Birth would need to be returned form the specified SmartObject and then needs to be diplayed in a control.

The above configuration will result in the following behaviour (Please see the below screenshots):
Hide contentShow content
When the user is a few days old

Kind Regards
Raymond